Element-wise Natural Log Calculator
Apply the natural logarithm ln(x) to every element of a matrix. All entries must be strictly positive (> 0).
Loading calculator…
Notes
Element-wise Natural Logarithm
The element-wise natural log applies ln(x) to each matrix entry independently. All entries must be strictly positive.
Example
Input A (all entries > 0):
| 1 | 2 |
| e | 4 |
Element-wise ln(A): ln(1)=0, ln(2)≈0.693, ln(e)=1, ln(4)≈1.386
| 0 | 0.693 |
| 1 | 1.386 |
All entries must be strictly positive. ln(0) = −∞ and ln(x) for x < 0 is undefined in the reals.
See also
- Matrix Calculations Guide — Element-wise Operations — In-depth notes on Element-wise Operations with worked examples
Frequently Asked Questions
Is this the matrix logarithm?
No. The matrix logarithm X satisfies e^X = A and is computed via eigendecomposition. This calculator applies ln() to each entry separately.
Where is element-wise ln used?
In statistics (log-transforming data matrices), machine learning (computing log-likelihoods entry-wise), and information theory.
Is element-wise ln the inverse of element-wise exp?
Yes. ln(e^x) = x for all real x, so applying element-wise exp then element-wise ln returns the original matrix.