Text-only
Table of Contents (
frame
/
no frame
)
(10) Solving Simultaneous Equations
Solving Simultaneous Equations
Use backslash operator
(\)
to solve simultaneous equations
Solve for x
1
,x
2
,x
3
-x
1
+ x
2
+ 2x
3
= 2
3x
1
- x
2
+ x
3
= 6
-x
1
+ 3x
2
+ 4x
3
= 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):
left division uses least squares regression "curve fit" of data
you receive warning if the solution is not unique (dependent columns)
For under determined systems (m<n)
Left division uses QR factorization with column pivoting
Solution is not unique
Solving_Simul_Eqs.src last modified Sep 29, 2009
Introduction
Table of Contents
(
frame
/
no frame
)
Printable
(single file)
© Dartmouth College