Hi,
Can anyone please guide me on what the abs function do when the argument is a complex number? Does it calculate the magnitude? In that case, what is the mathematical formulation for that?
Thanks
Hi,
Can anyone please guide me on what the abs function do when the argument is a complex number? Does it calculate the magnitude? In that case, what is the mathematical formulation for that?
Thanks
Yes, the magnitude.
If x
is a complex scalar, abs(x) = norm([real(x),imag(x)])
If X
is a complex array, this same calculation is performed for every element of the array.
This is the same behavior as MATLAB’s abs
when applied to numeric arguments.