Simulink Reference | ![]() ![]() |
Output the absolute value of the input
Library
Simulink Math Operations and Fixed-Point Blockset Math
Description
The Abs block outputs the absolute value of the input.
For signed data types, the absolute value of the most negative value is problematic since it is not representable by the data type. In this case, the behavior of the block is controlled by the Saturate on integer overflow check box. If checked, the absolute value of the data type saturates to the most positive representable value. If not checked, the absolute value of the most negative value represented by the data type has no effect.
For example, suppose the block input is an 8-bit signed integer. The range of this data type is from -128 to 127, and the absolute value of -128 is not representable. If the Saturate on integer overflow check box is selected, then the absolute value of -128 is 127. If it is not selected, then the absolute value of -128 remains at -128.
Data Type Support
An Abs block accepts a real- or complex-valued input of any data type except int64
and uint64
and outputs a real value of the same data type as the input.
Dialog Box
Characteristics
Dimensionalized |
Yes |
Direct Feedthrough |
Yes |
Sample Time |
Inherited from driving block |
Zero Crossing |
No, unless Enable zero crossing detection is selected |
![]() | Simulink Blocks | Action Port | ![]() |