logm
Matrix logarithm.
Category: Mathematics > Linear Algebra
Syntax
L = logm(A)
Returns the matrix L with expm(L) = A.
Description
logm inverts expm. It is not log(A), which takes the logarithm of each entry. The logarithm is computed from the Schur form with inverse scaling and squaring.
It is used, for example, to recover the generator of a continuous-time Markov chain from its transition matrix.
Input arguments
A- Square matrix, without eigenvalues on the negative real axis or at zero if a real result is needed.
Output arguments
L- The principal matrix logarithm; may be complex.
Example
Inverting expm
logm(eye(2))
A = expm([1 2; 0 1]);
logm(A)
logm([4 0; 0 9])
Output
ans = 2×2
0 0
0 0
ans = 2×2
1.0000 2.0000
0 1.0000
ans = 2×2
1.3863 0
0 2.1972