EE 221 Computing for Engineers Homework #11-Solution Write a script that will do
ID: 2249583 • Letter: E
Question
EE 221 Computing for Engineers Homework #11-Solution Write a script that will do the following 1-A=11 1-1 1 -1 1 2- Find the rank of A Find Determinant of A of the a given matrix A The conditional number of B & and inv(B) where B = 3- Find B orth(A). In Matlab, the command orth(A) provides a set of orthogonal vectors that are the basis 4 Verify that B is orthogonal to A 1 1.00001 6- The conditional number of A & and inv(A) where A=11 7- Solve for the system equation Ax b defined as: 2-1 1 1 1 1X11 [1 8- Show that the system in part 7 is consistent 9- Solve for the given underdetermined system Ax b and show if it is a consistent system 122.51 10- Solve for the given the overdetermined system Ax ba, and show if it is a consistent system Submit the script as a .M file. Make your work to be presentableExplanation / Answer
paste this code in your matlab
clc
close all
syms A B R1 R2
% 1-
A=[1 1 1
1 1 -1
1 -1 1];
% 2-
R=rank(A)
D=det(A)
% 3-
B=orth(A)
% 5-
B=[1 1.00001
2 1.99999];
inv_B=inv(B)
% 6-
A=[1 1 1
1 2 -1
1 -1 -2];
inv_A=inv(A)
% 7-
syms x y z
eqn1 = x + y + z == 1;
eqn2 = x + 2*y - z == 7;
eqn3 = x -y -2*z == 3;
sol = solve([eqn1, eqn2, eqn3], [x, y, z]);
x1 = sol.x
x2 = sol.y
x3 = sol.z
% 8-
A=[1 1 1
1 2 -1
1 -1 -2];
B=[1 7 3]';
R1=rank(A)
R2=rank([A B])
if R1==R2
disp('system is consistent')
end
% 9-
A=[1 -1 -.5
1 2 2.5];
B=[1 0]';
R1=rank(A)
R2=rank([A B])
if R1==R2
disp('system is consistent')
eqn1 = x - y -0.5*z == 1;
eqn2 = x + 2*y +2.5*z == 0;
sol = solve([eqn1, eqn2], [x, y, z]);
x1 = sol.x
x2 = sol.y
x3 = sol.z
end
% 10-
A=[1 2
2 1
2 2];
B=[3 3 4]';
R1=rank(A)
R2=rank([A B])
if R1==R2
disp('system is consistent')
eqn1 = x + 2*y == 3;
eqn2 = 2*x + y == 3;
eqn3 = 2*x +2*y == 4;
sol = solve([eqn1, eqn2, eqn3], [x, y]);
x1 = sol.x
x2 = sol.y
end
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.