Simulink Reference Previous page   Next Page
Abs

Output the absolute value of the input

Library

Math Operations

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

Saturate on integer overflow
When selected, the block maps signed integer input elements corresponding to the most negative value of that data type to the most positive value of that data type:
Enable zero crossing detection
Select to enable zero crossing detection. For more information, see Zero Crossing Detection in the Using Simulink documentation.
Sample time (-1 for inherited)
Specify the time interval between samples. To inherit the sample time, set this parameter to -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


Previous page  Blocks -- Alphabetical List Action Port Next page

© 1994-2005 The MathWorks, Inc.