MATLAB Answers


I'm attempting to determine the maximum value of a signal (SIMULINK) . The max block returns the exact same signal back to me. What can I do to extract the maximum value?

Asked by Ziad Almalak on 17 Jul 2018
Latest activity Commented on by Ziad Almalak on 17 Jul 2018


Sign in to comment.


1 Answer

Answer by Christopher Wallace on 17 Jul 2018
 Accepted Answer

If you want to do it purely in Simulink you could do something like this:
If you only need the data after the simulation is ran you could output the signal using the ToWorkspace block and then post process the data.


I can use MATLAB to do this task without any issues. The problem is, the MATLAB Code I intend on using is to be modelled in SIMULINK so that it may be used for real-time testing. The model takes in the 3 signals from the workspace. It's meant to process the signals, and then extract the maximum values from these signals and display them. I've tried using the max block and the original signal was returned. I've tried using the MATLAB function block to write up a code for determining the max, and that didn't workout either. I tried your method, and I still get nothing. Signals and vectors work differently in simulink, and so, if I can process the signal the right way, I can change it to a vector, and then attempt to determine the max that way. That's the purpose of my second question.
Hi Ziad,
Thanks for your explanation. I changed the model slightly, does this work for you?
If not, if you could upload your input data and a screenshot of your model I'd be glad to take a look.
Best, Chris

Sign in to comment.