| MATLAB Function Reference | Search  Help Desk |
| abs | Examples See Also |
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) = 5 abs(3+4i) = 5
See Also
angle, sign, unwrap