Main Content
log
Natural logarithm
Syntax
Description
returns
the natural logarithm ln(x) of
each element in array Y
= log(X
)X
.
The log
function’s domain includes
negative and complex numbers, which can lead to unexpected results
if used unintentionally. For negative and complex numbers z
= u + i*w
, the complex logarithm log(z)
returns
log(abs(z)) + 1i*angle(z)
If you want negative and complex numbers to return error messages
rather than return complex results, use reallog
instead.