expm
Matrix exponential.
Syntax
Section titled “Syntax”X = expm(A)Description
Section titled “Description”Returns the matrix exponential exp(A) — the matrix-valued sum I + A + A²/2! + A³/3! + …. Computed via the scaling-and-squaring Padé method (much more accurate than the elementwise exp(A), which gives a different result entirely).
Used in solving linear ODEs of the form dy/dt = A*y whose solution is y(t) = expm(A*t) * y(0).
Examples
Section titled “Examples”expm(zeros(3)) % IA = [0 1; -1 0];expm(A * pi) % approximately -I (rotation by π)