Simulink Reference Previous page   Next Page
Abs

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



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.

Characteristics

Dimensionalized
Yes
Direct Feedthrough
Yes
Sample Time
Inherited from driving block
Zero Crossing
No, unless Enable zero crossing detection is selected


Previous page  Simulink Blocks Action Port Next page

Learn more about the latest releases of MathWorks products:

 © 1994-2009 The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS