Matlab Mldivide and Lapack dgesv give different results

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

1 comentario

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.

Iniciar sesión para comentar.

Respuestas (0)

Preguntada:

el 26 de Feb. de 2015

Comentada:

el 26 de Feb. de 2015

Community Treasure Hunt

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

Start Hunting!

Translated by