Question: modify gaussel.m code to get a Matlab code (above) for the naive Gaussian elimination and a Matlab code for the Gaussian elimination with partial pivoting

 modify gaussel.m code to get a Matlab code (above) for the

naive Gaussian elimination and a Matlab code for the Gaussian elimination with

modify gaussel.m code to get a Matlab code (above) for the naive Gaussian elimination and a Matlab code for the Gaussian elimination with partial pivoting and (2) to use the Matlab codes for naive Gaussian elimination, the Gaussian elimination with partial pivoting, and gaussel.m to solve:

partial pivoting and (2) to use the Matlab codes for naive Gaussian

M-function 4.3 The following MATLAB function gaussel.m finds the solution of a linear system using Gaussian elimination with scaled partial pivoting. INPUTS are an n x n matrix A and an nx 1 coefficient vector b function gaussel(A,b) % Solve the system Ax=b using Gaussian elimination with scaled % partial pivoting n-length(b) x-zeros(n,1); fprintf( '); disp The augmented matrix is -') augm =[A b] for i=1 :n smax=0 for j=1 :n smax-max(smax,abs(A(i,j))); end c(i)-smax; end for k-1.n-1 rmax 0 for i-k.n R-abs(A(d(i),k))/c(d(i)); if (R>rmax) rmax=R end end dk-dj); d(j)=d(k) ; d(k)-dk; for i=k+1 :n m=A(d(i),k)/A(dk,k); for j-k+1:n A(d(i),j)=A(d(DJ)-m*A(dk.j); end end end % Perform the back substitution. M-function 4.3 The following MATLAB function gaussel.m finds the solution of a linear system using Gaussian elimination with scaled partial pivoting. INPUTS are an n x n matrix A and an nx 1 coefficient vector b function gaussel(A,b) % Solve the system Ax=b using Gaussian elimination with scaled % partial pivoting n-length(b) x-zeros(n,1); fprintf( '); disp The augmented matrix is -') augm =[A b] for i=1 :n smax=0 for j=1 :n smax-max(smax,abs(A(i,j))); end c(i)-smax; end for k-1.n-1 rmax 0 for i-k.n R-abs(A(d(i),k))/c(d(i)); if (R>rmax) rmax=R end end dk-dj); d(j)=d(k) ; d(k)-dk; for i=k+1 :n m=A(d(i),k)/A(dk,k); for j-k+1:n A(d(i),j)=A(d(DJ)-m*A(dk.j); end end end % Perform the back substitution

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!