MATLAB Solving Augmented Matrix: How to Use Matlab for Linear Algebra Help

AI Thread Summary
To solve an augmented matrix in Matlab, the user has defined matrix A and vector B for a 4x4 system. The correct Matlab commands to find the solution are either using the backslash operator with "solution = A\B" or by calculating the inverse with "solution = inv(A)*B". The user has already verified the solution through Gaussian Elimination, obtaining the results of 4, -3, 1, and 2. Both methods in Matlab should yield the same results as the manual calculation.
kahless2005
Messages
44
Reaction score
0
I have an augmented matrix that I need to solve. I have broken it into a 4x4 matrix and a vector. As seen below.

A= 0 1 1 1; 3 0 3 -4; 1 1 1 2; 2 3 1 3

B= 0; 7; 6; 6


I have already worked the matrix out by hand using Gaussian Elimination and have obtained the solution below

Solution: 4; -3; 1; 2

How, do I enter the system into Matlab to get the same answer?
 
Physics news on Phys.org
A= [0 1 1 1; 3 0 3 -4; 1 1 1 2; 2 3 1 3]
B= [0; 7; 6; 6]
solution=A\B
or
solution=inv(A)*B
 
Back
Top