Example 06
The backslash operator \
GIVEN: A System of three algebriac linear equations:
x + 4y - 3z = 1
-3x - 6y + z = 3
2x + 11y -5z = 0
REQUIRED: Solve the system.
SOLUTION: Generate example06.m
a=[1 4 -3; -3 -6 1; 2 11 -5];
b=[1; 3; 0];
solution=a\b
Example
solution =
-0.6667
-0.3333
-1.0000
Homework:
a. Solve:
a=[1 -1 3 0; -1 1 -1 0; -1 -2 5 0; 20 10 0 0];
b=[0 0 90 80]';
Please send questions or suggestions about this web page to beatnic@aset.psu.edu
ASET | ITS | Penn State
|