| Simulink Reference | ![]() |
Output the absolute value of the input
Library
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 you select the Saturate on integer overflow check box, 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
The Abs block accepts real signals of any data type supported by Simulink, except Boolean. The Abs block supports real fixed-point data types. The block also accepts complex single and double inputs. Outputs are 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.
Parameters and 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.
-1. See Specifying Sample Time in the online documentation for more information.
Characteristics
| Direct Feedthrough |
Yes |
| Sample Time |
Specified in the Sample time parameter |
| Dimensionalized |
Yes |
| Zero Crossing |
Yes, if enabled |
| Blocks -- Alphabetical List | Action Port | ![]() |
© 1994-2005 The MathWorks, Inc.