MATLAB Functions Help Desk

expm

Purpose

Matrix exponential

Syntax

Description

Y = expm(X) raises the constant e to the matrix power X. Complex results are produced if X has nonpositive eigenvalues.

Use exp for the element-by-element exponential.

Algorithm

The expm function is built-in, but it uses the Padé approximation with scaling and squaring algorithm expressed in the file expm1.m.

A second method of calculating the matrix exponential uses a Taylor series approximation. This method is demonstrated in the file expm2.m. The Taylor series approximation is not recommended as a general-purpose method. It is often slow and inaccurate.

A third way of calculating the matrix exponential, found in the file expm3.m, is to diagonalize the matrix, apply the function to the individual eigenvalues, and then transform back. This method fails if the input matrix does not have a full set of linearly independent eigenvectors.

References [1] and [2] describe and compare many algorithms for computing expm(X). The built-in method, expm1, is essentially method 3 of [2].

Examples

Suppose A is the 3-by-3 matrix

then expm(A) is

while exp(A) is

Notice that the diagonal elements of the two results are equal; this would be true for any triangular matrix. But the off-diagonal elements, including those below the diagonal, are different.

See Also

exp         Exponential

funm        Evaluate functions of a matrix

logm        Matrix logarithm

sqrtm       Matrix square root

References

[1] Golub, G. H. and C. F. Van Loan, Matrix Computation, p. 384, Johns Hopkins University Press, 1983.

[2] Moler, C. B. and C. F. Van Loan, "Nineteen Dubious Ways to Compute the Exponential of a Matrix," SIAM Review 20, 1979, pp. 801-836.



[ Previous | Help Desk | Next ]