In: Computer Science
Question 1
Using MATLAB solve the following system of linear simultaneous equations
3x + 2y - z = 10........... [1]
-x + 3y + 2z = 5........... [2]
x - y - z = -1 .................[3]
s + 2t - 3u + 4v = 12........... [1]
2s + 2t - 2u + 3v = 10......... [2]
t + u = -1............................ [3]
s - t + u - 2v = -4................ [4]
% 3x + 2y - z = 10........... [1]
% -x + 3y + 2z = 5........... [2]
% x - y - z = -1 .................[3]
A = [3 2 -1; -1 3 2; 1 -1 -1];
b = [10; 5; -1];
res = A\b;
x = res(1)
y = res(2)
z = res(3)
======================================================
A = [1 2 -3 4; 2 2 -2 3; 0 1 1 0; 1 -1 1 -2];
b = [12; 10; -1; -4];
res = A\b;
s = res(1)
t = res(2)
u = res(3)
v = res(4)
======================================================
-------------------------------------------
Thanks, let me know if you need more information. PLEASE COMMENT if
there is any concern.