matlab log函数编写,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.0533i

4、附录

>> 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

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值