Question: I need help coding in MATLAB for this assignment. In this exercise, you use the RREF and Rouch - Capelli Theorem to determine if Ax

I need help coding in MATLAB for this assignment.
In this exercise, you use the 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,vcols]=rref(A) returns B and pivcols, where matrix B=rref(A) and pivcols indicates pivot columns of A
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 an expression is true, it executes statements 1 block. Otherwise, it executes statements 2 block.
if expression
statements 1 block
else
statements 2 block
end
if-elseif statement
If expression 1 is true, it executes statements 1 block. If not, check expression 2. If expression 2 is true, it executes statements 2 block. If not, execute statements 3 block.
if expression 1
statements 1 block
etseif expression 2
statements 2 block
else
statements 3 block
end
A. Use the reduced row echelon form (RREF) to solve Ax=b, where A and b are indicated in Exercise 1, and type your answer for the following in the Live Editor.
Display the reduced row echelon form and the pivot columns of the augmented matrix [A b].
Write a report to explain if there is a solution of Ax=b based on rref([AB]).
Call the function rank_comp and determine if Ax=b is consistent.
Compare the result with Part A. You should have the same conclusion.
Note: rank_comp gives you a new command to compare if rank(A)=rank([A,b]). When you need to use the command, read the comments in the m-file function first and call the function by typing the name of the function, rank_comp (A, B), where A and B are the two input matrices.
C. Open the template Is_solution. Use the Rouch-Capelli Theorem as a guide and code the function using an if-elseif statement (do not use nested if-else statements). When LS_solution is called it should return the correct system type based on whether Ax=b has a solution and how many. The function should output/return/set system_type to:
inc if the system is inconsistent and has no solution, or
con_with_one_sol if the system is consistent and has a unique solution, or
con_with_inf_sols if the system is consistent and has infinitely many solutions.
Note: You should include three input arguments (n,A,Ab) for LS_solution, where n is the number of variables in the system of equations.
 I need help coding in MATLAB for this assignment. In this

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!