MATLAB: Simulink model in a for loop

simulink

Hi at all, I have a problem when I run a simulink model inside a for loop.
More in detail when I run the model with the command:
set_param('model_name','SimulationCommand','start')
the script doesn't wait the end of the simulation before continue…
There some commands like the waitfor or the drawnow?
Thanks
M1tc4

Best Answer

Hi Mitch,
I would usually suggest to use the function sim for running simulations, or is there any reason you can't use sim?
Titus