Question: Please I need help with the question I couldn't understand very well.. A) use it in matlab or octave to solve a) 2X2 system b)

Please I need help with the question I couldn't understand very well..
A) use it in matlab or octave to solve
a) 2X2 system
b) 4x4 system
c) 6x6 system
B) Compare the solutions you find using the gelim function with the solutions calculated by Matlab using the backslash operator (i.e. x=a\b if a is the coefficient matrix and b is the constant vector).
 Please I need help with the question I couldn't understand very

function [x. flag] gelima, b) %The purpose ofthis funtion is to solve a linear system a x-b using % Gaussian elimination with partial pivotmg. The calling procedure is [x, flag]-gelim(ab) % where: %a-coefficient matrix for the system(must be square) % b-constant vector for the system; % x computed solution (if found); %flag-oifasolution is found, or flag-0 ifthere is no unique solution. lag-0 ifm--n disp( the input matrix must be a square matrix) end for i-1:m-1 % Find the pivot element and check to make sure the pivot element is nonzero. amax.pl-max(absani if amax lag-i end p=p+i-1; % Interchange rows if necessary temp-a(1,1:n); emp-bi) bir bip) end % Apply the elementary row operations to zero the subdiagonal entries in column i for j-i-1 :n end end if a(n,n) end % Do the backward substitution. or i-n-I:-1 end

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!