mirror of
https://github.com/josdejong/mathjs.git
synced 2026-01-18 14:59:29 +00:00
820 B
820 B
Function expm
Compute the matrix exponential, expm(A) = e^A. The matrix must be square. Not to be confused with exp(a), which performs element-wise exponentiation.
The exponential is calculated using the Padé approximant with scaling and squaring; see "Nineteen Dubious Ways to Compute the Exponential of a Matrix," by Moler and Van Loan.
Syntax
math.expm(x)
Parameters
| Parameter | Type | Description |
|---|---|---|
x |
Matrix | A square Matrix |
Returns
| Type | Description |
|---|---|
| Matrix | The exponential of x |
Examples
var A = [[0,2],[0,0]]
math.expm(A); // returns [[1,2],[0,1]]