Y = log(X)
log
is an elementary function that operates element-wise on matrices. Its domain includes complex numbers, which can lead to unexpected results if used unintentionally.
log(X)
is the natural logarithm of the elements of X
. For complex or negative z, where z =
x +
y*i, the complex logarithm is returned:
log(-1)
is a clever way to generate pi
:
ans =
0.0000 + 3.1416i
exp
,log10
,logm
(c) Copyright 1994 by The MathWorks, Inc.