logNatural Log
log(A)A should be a numeric array.A.A.log(a) may be a complex number if a is complex or a negative real number.% Returning complex numbers.
log([-inf rand + rand*i -rand])
% Returning real numbers.
log([inf nan 0 rand])
ans =
Inf + 3.1416i -0.2468 + 1.2912i -0.9082 + 3.1416i
ans = 1e-1 ×
Inf NaN -Inf -5.6703