LOG Natural Logarithm Function
Section: Mathematical Functions
logfunction for its argument. The general syntax for its use is
y = log(x)
x is an
n-dimensional array of numerical type.
Integer types are promoted to the
double type prior to
calculation of the
log function. Output
y is of the
same size as the input
x. For strictly positive, real inputs,
the output type is the same as the input.
For negative and complex arguments, the output is complex.
Function InternalsMathematically, the
logfunction is defined for all real valued arguments
xby the integral
For complex-valued arguments,
z, the complex logarithm is
arg is the complex argument of
ExampleThe following piece of code plots the real-valued
logfunction over the interval
--> x = linspace(1,100); --> plot(x,log(x)) --> xlabel('x'); --> ylabel('log(x)');