next up previous
Next: About this document ... Up: matexp Previous: matexp

Matrix exponentials in MATLAB

The function expm can be used to calculate matrix exponentials (by contrast, exp simplify takes the exponential of each entry rather than the exponential of the matrix). Here is an example:


 
>> t=sym('t')
 
t =
 
t
 
>> A=[0 1;1 0]

A =

     0     1
     1     0

>> expm(A*t)
 
ans =
 
[  1/2*exp(t)+1/2*exp(-t), -1/2*exp(-t)+1/2*exp(t)]
[ -1/2*exp(-t)+1/2*exp(t),  1/2*exp(t)+1/2*exp(-t)]
 
>> exp(A*t)
 
ans =
 
[      1, exp(t)]
[ exp(t),      1]
 
>>


Michael Renardy
2001-12-06