Products & Services Solutions Academia Support User Community Company

Learn more about MATLAB   

abs - Absolute value and complex magnitude

Syntax

abs(X)

Description

abs(X) returns an array Y such that each element of Y is the absolute value of the corresponding element of X.

If X is complex, abs(X) returns the complex modulus (magnitude), which is the same as

sqrt(real(X).^2 + imag(X).^2)

Examples

abs(-5)
ans =
     5

abs(3+4i)
ans =
     5

See Also

angle, sign, unwrap

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2010- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS