How to get max from Scope (Simulink)

10,913

Solution 1

Based on your description, I think that the MinMax Running Resettable block would be more appropriate for your application.

The MinMax block will take multiple scalar value inputs (or a vector input) and output the minimum or maximum value (depending on your settings) of those inputs at the current instant in time. This would be better used to compare two signals, not to find the maximum value of a particular "stream" of signal data.

So, for example, let's say that you have a Sine Wave block that is feeding into a MinMax block (which has been set to output the max value). The MinMax block will look at all of its inputs at the current instant in time and output the maximum value. However, in this case, MinMax only has one input -- the sine wave. So the output of MinMax will actually be the same as the output of the Sine Wave block.

On the other hand, MinMax Running Resettable outputs the minimum or maximum of all past inputs. So for example, if you had a sine wave with a peak value of 231 that was being fed into the u input of a MinMax Running Resettable block, then by the end of the simulation, this block will output 231. This is, of course, provided that your simulation has run long enough that the sine wave has reached its peak value.

Note that the MinMax Running Resettable block was an R input that can be used to reset the block. If you simply want to find the max value of your signal over time and do not need to reset the block, then you can go ahead and just leave this input disconnected.

Solution 2

i once studied matlab at engineering school and i think you need to link the output of your sinusoid to a box called minmax

http://www.mathworks.com/help/simulink/slref/minmax.html

Share:
10,913
Zs.Zs.
Author by

Zs.Zs.

Updated on June 13, 2022

Comments

  • Zs.Zs.
    Zs.Zs. almost 2 years

    I would like to get only one number (maximum) from sinusoid in Matlab Simulink scope. I have a voltage measurement to measure AC voltage and current measurement. I need to find max. In my example the voltage is 231V and current is 0.26. the result number is 231*0.26 = .. to multiple it I need to get the max number from sinusoid.

    enter image description here

    Thanks a lot.