Matlab Mldivide and Lapack dgesv give different results
Mostrar comentarios más antiguos
It is mentioned in the documentation that Matlab solves systems A*X=B when A and B are square real matrices with lapack dgesv. But when I compared the results returned by Matlab and Lapack I found that they are similar if I enter A and B without semicolons, for example this way:
A=[0.5298, 0.4455, 0.0303, 0.6503,
0.2105, 0.0012, 0.2878, 0.2468,
0.9427, 0.1828, 0.8228, 0.3869,
0.6789, 0.6630, 0.1874, 0.9439]
but when I enter A and B with semicolons, for example
A2=[0.5298 0.4455 0.0303 0.6503;
0.2105 0.0012 0.2878 0.2468;
0.9427 0.1828 0.8228 0.3869;
0.6789 0.6630 0.1874 0.9439]
The solution X is different from lapack function dgesv
A and A2 aren't the same for Matlab? both are displayed the same way, have a 4x4 size and (A-A2) give a zero matrix
for more details, please refer to the following link http://stackoverflow.com/questions/28707052/different-results-between-lapack-and-matlab/28708290?noredirect=1#comment45744242_28708290 Thank you
1 comentario
Torsten
el 26 de Feb. de 2015
What if you set
X=A2'\B2';
?
I guess the solutions returned from LAPACK with A and B and MATLAB with A2' and B2' should agree, don't they ?
Best wishes
Torsten.
Respuestas (0)
Categorías
Más información sobre Linear Algebra en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!