Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Linear Algebra Matlab Help

  1. Mar 16, 2008 #1
    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?
     
  2. jcsd
  3. Mar 16, 2008 #2
    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
     
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook