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.

Calculate the Running Minimum Value with the MinMax Running Resettable Block

This example shows how to use the MinMax Running Resettable block to calculate the running minimum value. To watch how the running minimum value changes at each time step, you can use the Step Forward button to advance the simulation one step at a time.

After running the full simulation, you can view the results in the Scope. The initial value of the running minimum is 0. It begins tracking the Sine Wave signal when the sine wave values turn negative. When the MinMax Running Resettable block receives a reset signal at T=8, the block resets the running minimum value to 0. The running minimum value tracks at 0 for a few time steps, until the sine wave values turn negative again.

ans = 

  Simulink.SimulationOutput:
                   tout: [26x1 double] 

     SimulationMetadata: [1x1 Simulink.SimulationMetadata] 
           ErrorMessage: [0x0 char]