Function for telling if a function is unique and how many solutions it has.
Show older comments
Hello everyone, I'm a student who's being taught linear algebra, but being assigned matlab homework without any real explanation. I've come across this question and I need assistance with it:
Write an M-file function, that tells whether a system of linear equations has no solution, unique solution, or infinitely many solutions. The code should be such that you enter the coefficient matrix A and the corresponding column vector b. If the number of rows of A is different from the number of entries in b, the output should be an error message and execution stops. Otherwise, the output is a message indicating whether the system has no solution, unique solution, or infinitely many solutions. In this last case, it also tells the number of free variables of the system. In the case of unique solution, the code should also give the solution.
They gave me some p code to 'check what my code should do' as well but I honestly don't know how to use p-code and my version of MATLAB doesn't recognize it.

Accepted Answer
More Answers (0)
Categories
Find more on Programming in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!