Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Problem 1. To be completed in MATLAB. You are given a 30 x 31 Augmented matrix n

ID: 1715729 • Letter: P

Question

Problem 1. To be completed in MATLAB. You are given a 30 x 31 Augmented matrix named “ A ” (saved in the input_Matrix.mat file on Blackboard). The left 30 x 30 portion of the Augmented matrix is considered as the Matrix of Coefficients and the remaining 30 x 1 (the rightmost column) is considered as the Vector of Constants. Use Gaussian Elimination method to get the 30 x 1 solution vector. Hints: a) Perform Gaussian elimination of matrix “ A ”. This produces a 30 x 31 matrix. b) Using results from part (a), do a back substitution and generate a new 30 x 1 vector. This 30 x 1 vector should be the output of the given 30 x 31 matrix. Note: Add comments to each line of your code to explain what the code is doing

Explanation / Answer

I have made the generalized code. I used A=4*5 matrix.

you can use your matrix A=30*31. No need to change in the code. Just give the value of A aand run the code.

%Gauss elimination method
A=[3 4 -2 2 2; 4 9 -3 5 8; -2 -3 7 6 10; 1 4 6 7 2]

[m,n]=size(A)
%forward elemination
for j=1:m-1
for z=2:m % pivoting
if A(j,j)==0
t=A(j,:);A(j,:)=A(z,:);
A(z,:)=t;
end
end
for i=j+1:m % convert the elements below the major diagonal to zeros
A(i,:)=A(i,:)-A(j,:)*(A(i,j)/A(j,j));
end
end
% back sunstitution
x=zeros(1,m);
for s=m:-1:1
c=0;
for k=2:m
c=c+A(s,k)*x(k);
end
x(s)=(A(s,n)-c)/A(s,s);
end
disp('Gauss elimination method')
A
x'

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote