Interval Test

Determine if signal is in specified interval

  • Library:
  • Simulink / Logic and Bit Operations

Description

The Interval Test block outputs true (1) if the input is between the values specified by the Lower limit and Upper limit parameters. The block outputs false (0) if the input is outside those values. The output of the block when the input is equal to the Lower limit or the Upper limit is determined by whether you select the Interval closed on left and Interval closed on right check boxes.

Ports

Input

expand all

Input signal, specified as a scalar, vector, matrix, or N-D array.

Limitations

When the input signal is an enumerated type, the Upper limit and Lower limit values must be of the same enumerated type.

Data Types: single | double | int8 | int16 | int32 | uint8 | uint16 | uint32 | Boolean | fixed point | enumerated

Output

expand all

Output signal indicating whether the input values fall within the specified interval. You can specify the Output data type as boolean or uint8.

Data Types: uint8 | Boolean

Parameters

expand all

When you select this check box, the Upper limit is included in the interval for which the block outputs true (1).

Programmatic Use

Block Parameter: IntervalClosedRight
Type: character vector
Values: 'on' | 'off'
Default: 'on'

The upper limit of the interval for which the block outputs true (1).

Programmatic Use

Block Parameter: uplimit
Type: character vector
Values: scalar | vector | matrix | N-D array
Default: '0.5'

When you select this check box, the Lower limit is included in the interval for which the block outputs true (1).

Programmatic Use

Block Parameter: IntervalClosedLeft
Type: character vector
Values: 'on' | 'off'
Default: 'on'

The lower limit of the interval for which the block outputs true (1).

Programmatic Use

Block Parameter: lowlimit
Type: character vector
Values: scalar | vector | matrix | N-D array
Default: '-0.5'

Specify the output data type as boolean or uint8.

Programmatic Use

Block Parameter: OutDataTypeStr
Type: character vector
Values: 'boolean' | 'uint8'
Default: 'boolean'

Block Characteristics

Data Types

Boolean | double | enumerated | fixed point | integer | single

Direct Feedthrough

no

Multidimensional Signals

no

Variable-Size Signals

no

Zero-Crossing Detection

no

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

PLC Code Generation
Generate Structured Text code using Simulink® PLC Coder™.

Fixed-Point Conversion
Convert floating-point algorithms to fixed point using Fixed-Point Designer™.

Introduced before R2006a