Uploaded by bo.3leewaa

Matlab Hw3

advertisement
Q1
clear all
clc
% define the given system of equations in the form of AX=B
% matrix A is given as follows:
A=[3 6 4;
1 5 0;
0 7 7];
% matrix b is given as following coloumn vector:
B=[1;2;3];
% X=inv(A)*b. Note that the rightdivide \ operation compute matrix inverse
X=A\B; % thus, X gives the corresponding solution
% Display the result
fprintf('The solution to the given system of equations is:\n');
fprintf('a=%3.2f, b=%3.2f, c=%3.2f\n',X(1), X(2), X(3))
https://www.chegg.com/homework-help/questions-and-answers/write-code-take-screenshot-outputsmatlab-q27959860
Q2
Download