Simulink Reference | ![]() ![]() |
Perform the specified relational operation on the inputs
Library
Simulink Math Operations and Fixed-Point Blockset Logic & Comparison
Description
The Relational Operator block performs the specified comparison of its two inputs.
The relational operator connecting the two inputs is selected with the Relational Operator parameter. The block icon updates to display the selected operator. The supported operations are given below.
You can specify inputs as scalars, arrays, or a combination of a scalar and an array:
The output data type is specified with the Output data type mode and Output data type parameters. The output equals 1 for TRUE and 0 for FALSE.
Note The output data type selected should represent zero exactly. Data types that satisfy this condition include signed and unsigned integers and any floating-point data type. |
Data Type Support
A Relational Operator block accepts real or complex signals of any data type except int64
and uint64
. However, if the Output data type mode parameter is set to Logical
, the input may only be boolean
or double
.
One input can be real and the other complex if the operator is ==
or !=
.
Parameters and Dialog Box
boolean
, or choose to specify the data type through the Output data type parameter. Logical
to have the output data type determined by the Boolean Logic Signals parameter in the Advanced tab of the Simulink Simulation Parameters Interface. If you select Logical
and Boolean Logic Signals is on
, then the output data type is always boolean
. If you select Logical
and Boolean Logic Signals is off
, then the output data type will match the input data type is always double
.Specify via dialog
is selected for the Output data type mode parameter.Conversions and Operations
The input with the smaller positive range is converted to the data type of the other input offline using round-to-nearest and saturation. This conversion is performed prior to comparison. Refer to Parameter Conversions in the Fixed-Point Blockset documentation for more information about parameter conversions.
Characteristics
Dimensionalized |
Yes |
Direct Feedthrough |
Yes |
Sample Time |
Inherited from driving block |
Scalar Expansion |
Of inputs |
Zero Crossing |
No, unless Enable zero crossing detection is selected. |
![]() | Real-Imag to Complex | Relay | ![]() |