PLECS 1.3 Online Help

Compare Function

Purpose

Apply a compare expression to a continuous signal.

Library

Signals & Systems

Description

[Picture]

The Compare Function block generates a gate signal from a continuous signal by means of relational operators. The input may be a scalar or vectorized continuous signal, the output is always a scalar gate signal. The expression has C language syntax and may consist of one or more of the components listed below. Arithmetic and relational operators as well as mathematical functions may only be applied on continuous signals. Logical operators may only be applied on the results of comparisons.

The Compare Function icon can be distinguished from the Gate Function by the green instead of a brown input terminal.


Note  This block is intended for compound components that contain internally and/or externally controlled switches. It is for expert use only. The block shall not be used to implement controllers like a hysteresis type control, since this may lead to unexpected simulation results. Controllers should always be implemented directly in Simulink.

Parameters and Dialog Box

[Picture]

Expression
The expression applied to the input signal, in C language syntax.
Input width
The width of the input signal. The default is 2.