expm() products NaN as answer.
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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?
0 Kommentare
Antworten (1)
Matt J
am 20 Mai 2014
Bearbeitet: Matt J
am 20 Mai 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.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Whos finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!