Linear Algebra: Matlab Question

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
1 reply · 2K views
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.