mirror of
https://github.com/josdejong/mathjs.git
synced 2026-01-25 15:07:57 +00:00
1.2 KiB
1.2 KiB
| layout |
|---|
| default |
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 #
const A = [[0,2],[0,0]]
math.expm(A) // returns [[1,2],[0,1]]