复数的模

用abs函数可以求复数的模。该函数的语法格式为:

code.matlab
abs(Z)

结果返回复数的模。等价于sqrt(real(Z).۸2+imag(Z). ۸2)。

在命令窗口输入

code.matlab
>> abs(3+4i)
ans=
     5