Does Matlab use a QR or LU decomposition when solving a matrix equation?

11 views (last 30 days)
David
David on 13 Jul 2012
When Matlab computes A\B or A\b does it first compute the LU decomposition of A or the QR decomposition? I'm having accuracy issues and trying to compare my answers to those I get in C using LAPACK.
Thanks very much.
David

Accepted Answer

More Answers (1)

Paul Metcalf
Paul Metcalf on 16 Jul 2012
Edited: Paul Metcalf on 16 Jul 2012
I don't know the answer to your question, but you will need to provide more details to get a proper response to your question. For example:
  1. Is your matrix A square?
  2. What is the size/order of A?
  3. When using C/LAPACK, what data types have you cast for A?
  4. Are your results only slightly different or dramatically different?
MATLAB using DOUBLE arithmetic for all internal operations. If you are not using real64 types in C, then you might be accumulating quantisation errors...
  2 Comments
Paul Metcalf
Paul Metcalf on 18 Jul 2012
Glad you got it sorted. Out of curiosity, how long does your solution take?

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!