Using this sample matlab code: clear all; clc A= ????????; B= ????????; AUG=[A B]; for L=1:size(A,2) %Pivoting starts for k=L:size(AUG,1) for m=k+1:size(AUG,1) if abs(AUG(k,L))<abs(AUG(m,L)) temp=AUG(m,:); AUG(m,:)=?????????; AUG(k,:)=?????????; end end end %Pivoting ends %Gauss...

60.1K

Verified Solution

Question

Mechanical Engineering

Using this sample matlab code:

clear all;
clc
A= ????????;
B= ????????;
AUG=[A B];
for L=1:size(A,2)
%Pivoting starts
for k=L:size(AUG,1)
for m=k+1:size(AUG,1)
if abs(AUG(k,L))temp=AUG(m,:);
AUG(m,:)=?????????;
AUG(k,:)=?????????;
end
end
end
%Pivoting ends
%Gauss Elimination starts
for k=L+1:size(AUG,1)
AUG(k,:)= ????????????????????????????;
AA=AUG(:,1:size(A,2))
BB=AUG(:,size(A,2)+1:end)
end
%Gauss Elimination ends
end

b)Write a MATLAB M-file which performs gauss elimination withoutpivoting step by step and shows the coefficient matrix in eachstep. Using cond (X, P) calculate the condition number of the finalstep coefficient matrix (U matrix).

c) Write a MATLAB M-file which performs gauss elimination withpivoting step by step and shows the coefficient matrix in eachstep.

d)Using cond (X, P) calculate the condition number of the finalstep coefficient matrix (U matrix).

Answer & Explanation Solved by verified expert
4.2 Ratings (538 Votes)
clc clear Gauss elimination WITHOUT Pivoting A 3 1 4 1 5 2 3 1 7 b 1 4 7 n n sizeA Check for zero diagonal elements if anydiagA0 errorDivision by zero will occur pivoting not supported end Forward elimination for row1n1 for irow1n factor Airow Arowrow    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students