Text-only Table of Contents (frame/ no frame)
(10) Solving Simultaneous Equations Previous Top Next

Solving Simultaneous Equations



Use backslash operator (\) to solve simultaneous equations

Solve for x1,x2,x3

-x1 + x2  + 2x3 = 2
3x1 - x2  + x3  = 6
-x1 + 3x2 + 4x3 = 4

Ax = b

Try:
a = [-1 1 2; 3 -1 1; -1 3 4];
b = [2;6;4];
x = a\b
x =
     1.000  
    -1.000
     2.000

Note:
Given: [a] = m by n  [x] = n x1  [b] = m by 1
For overdetermined systems (m>n):
For under determined systems (m<n)








Previous Top Next


Solving_Simul_Eqs.src  last modified Sep 29, 2009 Introduction Table of Contents
(frame/no frame)
Printable
(single file)
© Dartmouth College