Main Content

Decrement Time To Zero

Decrease real-world value of signal by sample time, but only to zero

  • Decrement Time To Zero block

Libraries:
Simulink / Additional Math & Discrete / Additional Math: Increment - Decrement

Description

The Decrement Time To Zero block decreases the real-world value of the signal by the sample time, Ts. The output never goes below zero.

Examples

expand all

This example shows how to increase and decrease the real-world value of a signal using the following blocks:

  • Increment Real World

  • Decrement Real World

  • Decrement Time To Zero

  • Decrement To Zero

The Scope block shows the output of a Sine Wave block with amplitude 5, as well as the real-world value of that signal incremented and decremented by one.

The Scope1 block shows the output of a Sine Wave block with amplitude 3, as well as the output of the Decrement To Zero and Decrement Time To Zero blocks:

  • The Decrement To Zero block decreases the input sine wave signal by one, and ensures the value never goes below zero.

  • The Decrement Time To Zero block decreases the input sine wave signal by the sample time, Ts, and ensures that the value never goes below zero.

Limitations

The Decrement Time To Zero block works only with fixed sample rates and does not work inside a triggered subsystem.

Ports

Input

expand all

Input signal, specified as a scalar, vector, or matrix.

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

Output

expand all

Output is the real-world value of the input signal decreased by the sample time, Ts. The output never goes below zero. The output has the same data type and dimensions as the input.

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

Block Characteristics

Data Types

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

Fixed-Point Conversion
Design and simulate fixed-point systems using Fixed-Point Designer™.

Version History

Introduced before R2006a