Output absolute value of input
Simulink / Math Operations
HDL Coder / HDL Floating Point Operations
HDL Coder / Math Operations
The Abs block outputs the absolute value of the input.
For signedinteger data types, the absolute value of the most negative value is not representable by the data type. In this case, the Saturate on integer overflow check box controls the behavior of the block.
If you...  The block...  And... 

Select this check box  Saturates to the most positive value of the integer data type 

Do not select this check box  Wraps to the most negative value of the integer data type 

The Abs block supports zerocrossing detection. However, when you select Enable zerocrossing detection on the dialog box, the block does not report the simulation minimum or maximum in the FixedPoint Tool. If you want to use the FixedPoint Tool to analyze a model, disable zerocrossing detection for all Abs blocks in the model first.
Data Types 

Direct Feedthrough 

Multidimensional Signals 

VariableSize Signals 

ZeroCrossing Detection 
