| Simulink | ![]() |
www.kxcad.net Home > CAE Software Index > MATLAB Index >
Determine how signal compares to zero
Logic and Bit Operations

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:
== — Determine whether the input is equal to zero.
~= — Determine whether the input is not equal to zero.
< — Determine whether the input is less than zero.
<= — Determine whether the input is less than or equal to zero.
> — Determine whether the input is greater than zero.
>= — Determine whether the input is greater than or equal to zero.
The output is 0 if the comparison is false, and 1 if it is true.
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, see Data Types Supported by Simulink.

Specify how the input is compared to zero, as discussed in Description.
Specify the data type of the output, uint8 or boolean.
Select to enable zero-crossing detection. For more information, see Zero-Crossing Detection.
Direct Feedthrough | Yes |
Scalar Expansion | Yes |
Zero Crossing | Yes, if enabled. |
Multidimensionalized | Yes |
| Compare To Constant | Complex to Magnitude-Angle | ![]() |
© 1984-2007 The MathWorks, Inc. Terms of Use Patents Trademarks Acknowledgments