| MATLAB Function Reference | ![]() |
Absolute value and complex magnitude
Syntax
Y = abs(X)
Description
abs(X)
returns the absolute value,
, for each element of X.
If X is complex, abs(X) returns the complex modulus (magnitude),
abs(X) = sqrt(real(X).^2 + imag(X).^2)
Examples
abs(-5)
ans =
5
abs(3+4i)
ans =
5
See Also
| workspace | acos, acosh | ![]() |