Compare To Constant - Determine how signal compares to specified constant

Library

Logic and Bit Operations

Description

The Compare To Constant block compares an input signal to a constant. Specify the constant in the Constant value parameter. Specify how the input is compared to the constant value 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 Constant block accepts inputs of any data type supported by Simulink® software, including fixed-point data types. The block first converts its Constant value parameter to the input data type, and then performs the specified operation. 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 software, see Data Types Supported by Simulink®.

Parameters and Dialog Box

Operator

Specify how the input is compared to the constant value, as discussed in Description.

Constant value

Specify the constant value to which the input is compared.

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.

Characteristics

Direct Feedthrough

Yes

Scalar Expansion

Yes

Multidimensionalized

Yes

Zero Crossing

Yes, if enabled.

See Also

Compare To Zero

  


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