Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Next Generation Databases NoSQLand Big Data

Authors: Guy Harrison

1st Edition

1484213300, 978-1484213308

More Books

Students also viewed these Databases questions

Question

KEY QUESTION Refer to the table in question

Answered: 1 week ago

Question

What is DDL?

Answered: 1 week ago