How to calculate expm of a matrix?

3 views (last 30 days)
Omar B.
Omar B. on 21 Jun 2020
Commented: madhan ravi on 22 Jun 2020
Hi all, I am trying to run the following but I got an erorr
Error in expm
if ~all(isfinite(A),'all')
How can I fix that error?
H=[ 0.650 0.202 0 0 0 0 0 0 0;0.202 0.650 -0.164 0.066 0 0 0 0 0;0 -0.168 0.779 0.165 0 0 0 0 0;0 0.066 0.165 0.648 -0.164 0.064 0 0 0;0 0 0 -0.164 0.776 0.164 0 0 0;0 0 0 0.064 0.164 0.649 0.168 0.051 0;0 0 0 0 0 0.168 0.547 0.168 0;0 0 0 0 0 0.051 0.168 0.650 -0.168;0 0 0 0 0 0 0 -0.168 0.547];
w=expm(H)
  6 Comments
Walter Roberson
Walter Roberson on 22 Jun 2020
Having that error message earlier would have helped a lot.

Sign in to comment.

Accepted Answer

Steven Lord
Steven Lord on 22 Jun 2020
You've written your own script all.m that's being called instead of the all function built into MATLAB. Rename or remove your file /Users/jga/Documents/MATLAB/all.m so MATLAB can call the built-in function.

More Answers (1)

madhan ravi
madhan ravi on 21 Jun 2020
clear expm
  7 Comments
Omar B.
Omar B. on 22 Jun 2020
I understand, it was working before I update Matlab from 2017 to 2020. I do not know where is the problem.

Sign in to comment.

Categories

Tags

Community Treasure Hunt

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

Start Hunting!