Simulink Reference Previous page   Next Page
Compare To Zero

Determine how a signal compares to zero

Library

Logic and Bit Operations

Description

The Compare To Zero block compares an input signal to zero. Specify how the input is compared to zero with the Operator parameter. The Operator parameter can have the following values:

The output is 0 if the comparison is false, and 1 if it is true.

Data Type Support

The Compare To Zero block accepts inputs of any data type supported by Simulink, including fixed-point data types. The block output is uint8 or Boolean as specified by the Output data type mode parameter.

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

Operator
Specify how the input is compared to zero, as discussed in Description.
Output data type mode
Specify the data type of the output, uint8 or Boolean.
Enable zero crossing detection
Select to enable zero-crossing detection. For more information, see Zero Crossing Detection in the Using Simulink documentation.

Characteristics

Direct Feedthrough
Yes
Scalar Expansion
Yes
Zero Crossing
Yes, if enabled.

See Also

Compare To Constant


Previous page  Compare To Constant Complex to Magnitude-Angle Next page

© 1994-2005 The MathWorks, Inc.