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
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