Wrap To Zero

Set output to zero if input is above threshold

  • Library:
  • Simulink / Discontinuities

    HDL Coder / Discontinuities


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.



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 | uint8 | uint16 | uint32 | Boolean | fixed point


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.


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 | uint8 | uint16 | uint32 | Boolean | fixed point


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


Multidimensional Signals


Variable-Size Signals


Zero-Crossing Detection


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™.

Introduced before R2006a