Using Simulink    
Relational Operator

Perform the specified relational operation on the input.

Library

Math

Description

The Relational Operator block performs a relational operation on its two inputs and produces output according to the following table.

Operator
Output
==
TRUE if the first input is equal to the second input
~=
TRUE if the first input is not equal to the second input
<
TRUE if the first input is less than the second input
<=
TRUE if the first input is less than or equal to the second input
>=
TRUE if the first input is greater than or equal to the second input
>
TRUE if the first input is greater than the second input

If the result is TRUE, the output is 1; if FALSE, it is 0. You can specify inputs as scalars, arrays, or a combination of a scalar and an array:

The block icon displays the selected operator.

Data and Numeric Type Support

A Relational Operator block accepts real or complex signals of any data type. Both inputs must be of the same data type. One input may be real and the other complex, if the operator is == or !=. The block outputs a signal of type boolean, if Boolean logic signals are enabled (see Enabling Strict Boolean Type Checking). Otherwise, the block outputs a signal of type double.

Parameters and Dialog Box

Operator
The relational operator to be applied to the block inputs.

Characteristics

Direct Feedthrough
Yes
Sample Time
Inherited from driving block
Scalar Expansion
Of inputs
Dimensionalized
Yes
Zero Crossing
Yes, to detect when the output changes


 Real-Imag to Complex Relay