MATLAB Function Reference
  Go to function:
    Search    Help Desk 
log    Examples   See Also

Natural logarithm

Syntax

Description

The log function operates element-wise on arrays. Its domain includes complex and negative numbers, which may lead to unexpected results if used unintentionally.

Y = log(X) returns the natural logarithm of the elements of X. For complex or negative z, where z = x + y*i, the complex logarithm is returned:

Examples

The statement abs(log(-1)) is a clever way to generate :

See Also

exp         Exponential

log10       Common (base 10) logarithm

log2        Base 2 logarithm and dissect floating-point numbers into exponent and mantissa

logm        Matrix logarithm



[ Previous | Help Desk | Next ]