MATLAB Compiler | ![]() ![]() |
Natural logarithm for nonnegative real inputs.
Syntax
Y = reallog(X)
Description
reallog
is an elementary function that operates element-wise on matrices. reallog
returns the natural logarithm of X
. The domain of reallog
is the set of all nonnegative real numbers. If X
is negative or complex, reallog
issues an error message.
reallog
is similar to the MATLAB log
function; however, the domain of log
is much broader than the domain of reallog
. The domain of log
includes all real and all complex numbers. If Y
is real, you should use reallog
rather than log
for two reasons.
First, subsequent access of Y
may execute more efficiently if Y
is calculated with reallog
rather than with log
. Using reallog
forces the MATLAB Compiler to impute a real type to X
and Y
. Using log
typically forces the MATLAB Compiler to impute a complex type to Y
.
Second, the compiled version of reallog
may run somewhat faster than the compiled version of log
. (However, the interpreted version of reallog
may run somewhat slower than the interpreted version of log
.)
See Also
exp
, log
, log2
, logm
, log10
, realpow
, realsqrt
![]() | mbvector | realpow | ![]() |