# expm

## 语法

``Y = expm(X)``

## 说明

``Y = expm(X)` 计算 `X` 的矩阵指数。虽然不按此种方式计算，但是如果 `X` 包含一组完整的特征向量 `V` 和对应特征值 `D`，则 `[V,D] = eig(X)` 且expm(X) = V*diag(exp(diag(D)))/V对于逐个元素的指数运算，请使用 `exp`。`

## 示例

```A = [1 1 0; 0 0 2; 0 0 -1]; exp(A)```
```ans = 3×3 2.7183 2.7183 1.0000 1.0000 1.0000 7.3891 1.0000 1.0000 0.3679 ```
`expm(A)`
```ans = 3×3 2.7183 1.7183 1.0862 0 1.0000 1.2642 0 0 0.3679 ```

## 算法

`expm` 使用的算法如  中所述。

 Higham, N. J., “The Scaling and Squaring Method for the Matrix Exponential Revisited,” SIAM J. Matrix Anal. Appl., 26(4) (2005), pp. 1179–1193.

 Al-Mohy, A. H. and N. J. Higham, “A new scaling and squaring algorithm for the matrix exponential,” SIAM J. Matrix Anal. Appl., 31(3) (2009), pp. 970–989.

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

 Moler, C. B. and C. F. Van Loan, “Nineteen Dubious Ways to Compute the Exponential of a Matrix,” SIAM Review 20, 1978, pp. 801–836. Reprinted and updated as “Nineteen Dubious Ways to Compute the Exponential of a Matrix, Twenty-Five Years Later,” SIAM Review 45, 2003, pp. 3–49.