Try it yourself:


logm(): Matrix Logarithm

logm() computes a matrix logarithm: a matrix L for which expm(L) equals the original matrix. It is used in continuous-time systems, interpolation of transformations, and advanced linear algebra.

Important caveats

A matrix logarithm is not obtained by applying log() to each entry. Use expm() to check a result. Matrix logarithms may be complex or non-unique, so domain assumptions and branch choices matter.

Input should be square; verify it with size(). Eigenvalue analysis through eigs() can help explain existence and numerical sensitivity.

All functions