In: Computer Science
Only MATLAB solution is required. No handwritten solution requested.
Given the system of equations
− 1.1x1 + 10x2 = 120
− 2x1 + 17.4x2 = 174
(a) Solve graphically and check your results by substituting them back into the equations. ( 15 pts. )
(b) On the basis of the graphical solution, what do you expect regarding the condition of the system? ( 5 pts. )
(c) Compute the determinant ( 5 pts. ).
clc;clear all
f1=@(x) (120+1.1*x)/10; %Equation 1
f2=@(x) (174+2*x)/17.4; %Equation 2
fplot(f1);hold on;fplot(f2); %Plots both
A=[-1.1 10;-2 17.4]; %Matrix of coefficients
solution=inv(A)*[120;174] %Finds the solution
determinant=det(A) %Computes determinants
conditionno=cond(A) %Finds condition number
%The system is ill conditioned as the condition number is high