Question: In this exercise, you will be solving a non-homogeneous system A x = b ( b = 0 ) with a general m n matrix

In this exercise, you will be solving a non-homogeneous system Ax = b ( b = 0 ) with a general

mn matrix A. The case when there are infinitely many solutions is included. **Create a function in MATLAB, called nonhomogen, that begins with the lines:

function x=nonhomogen(A,b) [~,n]=size(A); fprintf('Reduced echelon form of [A b] is ') R=rref([A,b]) 

(Do not put semicolon after the line R=rref([A,b]) to have R as an output the reduced echelon form of the augmented matrix [A,b] will allow you to verify your answers by hand.)

**First, you need to determine whether the system is consistent and, if yes, whether there is a unique solution or there are infinitely many solutions. You could use a conditional if ... elseif ... else statement. (1) If the equation Ax=b is not consistent, output the message 'The system is inconsistent' and the solution x has to be an empty vector.

(2) If the equation is consistent and the solution is unique - output the message 'The system has a unique solution' and use the backslash operator, A\b, to find the solution (see also Exercise 3 in this Project);

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!