This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Increment and Decrement Real-World Values

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.