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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started