Borrar filtros
Borrar filtros

expm() products NaN as answer.

3 visualizaciones (últimos 30 días)
xinyu
xinyu el 20 de Mayo de 2014
Editada: Matt J el 20 de Mayo de 2014
I have the matrix
A=1.0 e 04*
1.3371 0.0000 0 0
0.0130 -0.0000 0 0
0.0000 0 -0.0001 0.0001
0.0000 0 -0.0001 0.0001
Only 0 is a real 0 and 0.0000 is because the number is too small to show at such a scale. The expm(A) gives NaN as ans. I thought it is because of the matrix is badly scaled. But it works fine for expm(-A). So, where the problem is and how can I get the right ans?

Respuestas (1)

Matt J
Matt J el 20 de Mayo de 2014
Editada: Matt J el 20 de Mayo de 2014
It is badly scaled. Try
>> expm(A/1e4) %finite result, better scaled
Now try computing expm(A) in the following equivalent way,
>> expm(A/1e4)*exp(1e4) %the desired computation, but non-finite result
The fact that exp(1e4)=Inf ruins everything.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by