Question: Matlab help (layout already given) DISPLAY IN MATLAB THE 2 M-FILE FUNCTIONS GIVEN In this exercise, you use RREF and Rouch-Capelli Theorem to determine if

Matlab help (layout already given)

Matlab help (layout already given) DISPLAY IN MATLAB THE 2 M-FILE FUNCTIONS

DISPLAY IN MATLAB

GIVEN In this exercise, you use RREF and Rouch-Capelli Theorem to determine

THE 2 M-FILE FUNCTIONS GIVEN

if Ax=b is consistent. You may need the following commands for this

exercise. - The command rref (A) returns the reduced row echelon form

In this exercise, you use RREF and Rouch-Capelli Theorem to determine if Ax=b is consistent. You may need the following commands for this exercise. - The command rref (A) returns the reduced row echelon form of a matrix A - The command [B,pivot]= returns the matrix B=rref(A) and pivot indicates pivot columns - The command rank (A) returns the rank of a matrix A You also need two m-file functions rank_comp (given) and LS_solution (template only). In these functions, you need to know - if-else statement: If expression is true, it executes the statements1 block. Otherwise, it executes the statements2 block. if expression statements1 else statements2 end - if-elseif statement: If expression1 is true, it executes the statements1 block. If not, check expression2. If expression2 is true, it executes the statements 2 block. If not, executes the statements 3 block. if expression 1 statements1 elseif expression 2 statements2 else statements 3 end Exercise 2 - solving Ax=b \#2 (a) [[B,pivot] The matrix B is ... and pivot ... The system Ax=b is consisten or inconsistent because ... \#2 (b) rank_comp() By Rouch-Capelli Theorem, the system Ax=b is consisten or inconsistent. Compare your result with part (a). #2 (c) \[ \begin{array}{l} {[\mathrm{m}, \mathrm{n}]=\operatorname{size}(\mathrm{A})} \\ \text { LS_solution() } \end{array} \] function rank_comp(A, Ab) % Compare the rank of A and its augmented matrix [A b] % A = coefficient matrix of linear equations % Ab = corresponding augmented matrix [A b] if rank(A)==rank(Ab) disp(rank([A]) equals to rank([A b ])) else disp('rank( [A]) does not equal to rank([A b ])) end end function LS_solution( n,A,Ab) % Purpose of this function %n= %A= %Ab= % modify the function rank_comp.m if elseif else end 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!