Question

The problem: Write a general an M-file to solve a system of linear equations by using Cramers Rule. You should have in the argument (A, b,n), which (A) represents the coefficients, and (b) is a column vector that represents the right hand- side of the equations, and(n) represents the number of equations or the unknowns.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

For solving equation in matlab, linsolve() is the correct function.

It uses LU factorization with partial pivoting when A is square and QR factorization with column pivoting. The number of rows of A must equal the number of rows of B. If A is x-by-z and B is s-by-t, then X is z-by-t.

[X, R] = linsolve(A,B) suppresses these warnings and returns R, which is the reciprocal of the condition number of A if A is square, or the rank of A if A is not square.

X = linsolve(A,B,opts) solves the linear system A*X = B or A'*X = B, using the solver that is most appropriate given the properties of the matrix A, which you specify in opts. F

Add a comment
Know the answer?
Add Answer to:
The problem: Write a general an M-file to solve a system of linear equations by using...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT