Table of Contents
Compare
Compares two signals.
Library
MATLAB Command Line
Click to copy the following command line to the clipboard. Then paste it in the MATLAB Command Window:
qc_open_library('quarc_library/Logic Operations')Description
The Compare block compares its two input signals and outputs the result of the comparison. It is a simplified version of the
MATLAB Command Line
Click to copy the following command line to the clipboard. Then paste it in the MATLAB Command Window:
doc('Relational Operator');The block compares the first input to the second input. For example, if the operator selected is "<" then it will output the result of the comparison:
(first input < second input)
If the input signals are vectors then the output will be a vector of the same dimensions, with each element representing the comparison applied to the corresponding input elements. One of the inputs may be a scalar when the other input is a vector. The Compare block supports multidimensional signals as well.
Input Ports
u
The first operand in the comparison.
v
The second operand in the comparison.
Output Ports
y
The result of the comparison. The data type of the output is determined by the Output data type parameter.
Data Type Support
The Compare block supports any of the standard Simulink data types at its input. It does not currently support fixed-point signals. The output may be a boolean or uint8.
Parameters and Dialog Box
Operator
The comparison operator to apply. The block compares the first input to the second input using the given operator.
Output data type
The data type to use for the output. Only two data types are currently supported: boolean and uint8.
Use the uint8 data type if arithmetic operations are going to be performed on the output. For example, if a Gain block is applied to a boolean signal it produces a boolean 0 or 1 result rather than multiplying the output by the gain. However, if the Gain block is applied to a uint8 data type then it produces the expected multiplied output.
Targets
Target Name |
Compatible* |
Model Referencing |
Comments |
---|---|---|---|
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
Last fully supported in QUARC 2018. |
|
Rapid Simulation (RSIM) Target |
Yes |
Yes |
|
S-Function Target |
No |
N/A |
Old technology. Use model referencing instead. |
Normal simulation |
Yes |
Yes |
See Also
Copyright ©2024 Quanser Inc. This page was generated 2024-10-17. Submit feedback to Quanser about this page.
Link to this page.