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]