Main Content

Wrap To Zero

Set output to zero if input is above threshold

  • Wrap To Zero block

Libraries:
Simulink / Discontinuities
HDL Coder / Discontinuities

Description

The Wrap To Zero block sets the output to zero when the input is above the Threshold value. When the input is less than or equal to the Threshold, then the output is equal to the input.

Ports

Input

expand all

Input signal, specified as a scalar or vector. Signal values equal to or greater than the value of Threshold are set to zero.

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

Output

expand all

Output signal set to the input signal value or zero. The data type of the output is the same data type as the input.

Tip

If the input data type cannot represent zero, parameter overflow occurs. To detect this overflow, go to the Diagnostics > Data Validity pane of the Configuration Parameters dialog box and set Parameters > Detect overflow to warning or error.

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

Parameters

expand all

To edit the parameters for the Wrap to Zero block, double-click the block icon.

Threshold value for setting the output value to zero.

Programmatic Use

Block Parameter: Threshold
Type: character vector
Values: scalar
Default: '255'

Block Characteristics

Data Types

Boolean | double | fixed point | integer | single

Direct Feedthrough

yes

Multidimensional Signals

yes

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
Design and simulate fixed-point systems using Fixed-Point Designer™.

Version History

Introduced before R2006a