Azzera filtri
Azzera filtri

expm() products NaN as answer.

3 visualizzazioni (ultimi 30 giorni)
xinyu
xinyu il 20 Mag 2014
Modificato: Matt J il 20 Mag 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?

Risposte (1)

Matt J
Matt J il 20 Mag 2014
Modificato: Matt J il 20 Mag 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.

Community Treasure Hunt

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

Start Hunting!

Translated by