log 函数
Natural logarithm
自然对数
Syntax
语法
Y = log(X)
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.
log函数在阵列上操作元素方法。其区域包括复数和负数,如果不小心使用,其可以导致意外结果。
Y = log(X) returns the natural logarithm of the elements of X. For complex or negative, where , the complex logarithm is returned.
Y=log(X)返回X的每个元素的自然对数。复形或负数z,,复形对数是返回值。
log(z) = log(abs(z)) + i*atan2(y,x)
Examples
例如:
The statement abs(log(-1)) is a clever way to generate .
语句abs(log(-1))是一个巧妙的方式产生。
ans =
3.1416