| 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 real signals of any data type supported by Simulink except boolean, including fixed-point data types. The Abs block also accepts complex single and double inputs. The block outputs a real value of the same data type as the input.
For a discussion on the data types supported by Simulink, refer to Data Types Supported by Simulink in the Using Simulink documentation.
Dialog Box

When not selected, the block does not act on signed integer input elements corresponding to the most negative value of that data type.
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 | ![]() |
Learn more about the latest releases of MathWorks products: |
| © 1994-2009 The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |