Engee documentation

Compare To Constant

Comparison of the input signal with a constant.

compare to constant

Description

The Compare To Constant block compares the input signal with a constant specified in the Constant value parameter. The method of comparison is specified by the Operator parameter.

Ports

Input

Port_1 - input signal
scalar

Input signal as a scalar for comparison with a constant.

Data types: Float16, Float32, Float64, Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64, Bool.

*Support for complex numbers: Yes

Output

Port_1 - output signal
0 | 1

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

Data types: Bool, UInt8.

Parameters

Main

Operator - logical operator
< = (by default) | ~= | == | < | >= | >

This parameter can have the following values:

  • - determines whether the input value is equal to a constant.

  • - determines whether the input value is not equal to a constant.

  • - determines if the input value is less than a constant

  • - determines whether the input value is less than or equal to a constant.

  • - determines whether the input value is greater than a constant.

  • - determines whether the input value is greater than or equal to a constant.

Usage in program code

Block parameter

relop

Value

== | ~= | < | < = | >= | > | isInf | isNaN | isFinite

* By default*

< =

Constant value - constant for comparison
scalar | vector | matrix

The constant value to which the value of the input signal is compared.

Usage in program code

Block parameter

const

Value

scalar | vector | matrix

By default

3.0

Output data type - output data type
Bool (by default) | UInt8

Specify output data type Bool or UInt8.

Usage in program code

Block parameter

OutDataTypeStr

Value

Bool | UInt8

By default

Bool

Additional options

C code generation: Yes