solving linear system with decomposition(A,'qr') and qr(A) produce different results
Show older comments
load post.mat
x1 = decomposition(CA,'qr')\b_f;
[qq2,rr2,pp2] = qr(CA);
x2= pp2 * (rr2\(qq2'*b_f));
[qq3,rr3,pp3] = qr(CA,"econ","vector");
x3(pp3,:) = rr3\(qq3'*b_f);
any(x1-x2~=0)
any(x3-x2~=0)
I know that the CA matrix is ill-conditioned. But that doesn't explain the difference in solution, right?
Also, solving the system using decomposition(CA,'lu') and lu(CA) produce the same results. So why not the 'qr' pair?
Accepted Answer
More Answers (0)
Categories
Find more on Linear Algebra 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!