Linear Algebra: Matlab Question

Click For Summary
The discussion revolves around a linear algebra problem requiring the creation of a Matlab function to find the inverse of a 2x2 matrix using row reduction, without utilizing built-in functions like rref or inv. The user initially expresses confusion about the assignment but later claims to have solved it by using a simple division of the matrix by the identity matrix. However, another participant questions whether this approach truly addresses the problem requirements. The conversation highlights the importance of understanding the specific instructions for coding in Matlab while solving linear algebra problems. Ultimately, the user reflects on the simplicity of the solution after overcoming initial confusion.
mmont012
Messages
39
Reaction score
0
I am taking a linear algebra class, and it has a required lab associated with it. Here is the following problem that I must solve using Matlab

1. Homework Statement

Write a function using row reduction to find the inverse for any given 2x2 matrix. Name your function your initial + inv(M), the output will be the inverse matrix. Test your function with the matrices in problem 1 and check the results by multiplying the inverse to the matrix for the linear system:

x1-2x2=3
2x1+4x2=-5

Solve it by using the inverse matrix you find and then use M/B. Compare the results.
Note: You can't use rref or use inv(M) in your function, you can only use row reduction)

Homework Equations


Here are the matrices from problem 1:
M1: [2,3;4,5]
M2: [1,-2,0;4,-7,1;0,3,5]

The Attempt at a Solution


I'm new to Matlab and I don't know what the teacher is asking. If someone could clarify the instructions that would be very helpful.

As a side note, I typed everything word for word from the handout.
_________________________________________________________________________
EDIT:
I figured it out.

% Let A= Matrix, Let IM= Identity matrix
x=A/IM

Ugh... so simple... I wish that I didn't waste so much time on this problem.

Thank you for looking.
 
Last edited:
Physics news on Phys.org
mmont012 said:
EDIT:
I figured it out.

% Let A= Matrix, Let IM= Identity matrix
x=A/IM

Ugh... so simple... I wish that I didn't waste so much time on this problem.

Thank you for looking.
I don't see how this solves the problem you are asked.
 

Similar threads

  • · Replies 7 ·
Replies
7
Views
741
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 19 ·
Replies
19
Views
4K
  • · Replies 48 ·
2
Replies
48
Views
5K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
Replies
2
Views
1K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 17 ·
Replies
17
Views
8K
  • · Replies 25 ·
Replies
25
Views
3K