Question: Write a Matlab function that takes a matrix A and a vector b as input and computes the solution to the system of equations Ax=B
Write a Matlab function that takes a matrix A and a vector b as input and computes the solution to the system of equations
Ax=B
Your function should check to make sure that a solution is possible, and if it is not you should raise an error. Check at least the following conditions:
A must be a square matrix and b must be a column vector.
The dimensions of A and b must match.
The determinant of A must be non-zero.
The requirement of b as a column vector seems a bit excessive as both row and column vectors are just 1D arrays as far as Matlab is concerned. Modify your function to be able to handle row vectors as well as column vectors.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
