Matlab基本函数-log函数

1、log函数:求自然对数

2、用法说明

      y = log(x) 函数对数组x的元素逐个进行以e为底的对数运算。y = a+b*i,有log(y) = log(abs(y))+i*atan2(b,a)

3、举例说明

>> x = 10 x = 10 >> y = log(x) y = 2.3026 >> x = 1:10 x = 1 2 3 4 5 6 7 8 9 10 >> y = log(x) y = 0 0.6931 1.0986 1.3863 1.6094 1.7918 1.9459 2.0794 2.1972 2.3026 >> x = [34-45i 12+23i 56+78i 26.12-45.89i] x = 34.0000 -45.0000i 12.0000 +23.0000i 56.0000 +78.0000i 26.1200 -45.8900i >> y = log(x) y = 4.0325 - 0.9237i 3.2559 + 1.0899i 4.5646 + 0.9481i 3.9666 - 1.0533i4、附录

>> help log log Natural logarithm. log(X) is the natural logarithm of the elements of X. Complex results are produced if X is not positive. See also log1p, log2, log10, exp, logm, reallog. Overloaded methods: codistributed/log gpuArray/log fints/log designdev/log Reference page in Help browser doc log


内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/zzfpyg.html