About controlling Simulink model execution at run time
Show older comments
I would like to run a Simulink model from a MATLAB script. Is there a way to eventually stop and restart the simulation, depending on a particular signal value in the model?
In particular, my application is a transmission chain. Since I don't know in advance the proper noise level to set, I'd like to run the model with an initial one, and then eventually stopping, changing the parameter, and restarting, depending on the Error Rate Calcutation, which indeed is a signal in the model.
I've read about accessing blocks data at run time in the documentation, but still I didn't understand if I can do what I want.
Thanks for any help, Luca
Accepted Answer
More Answers (1)
David Sanchez
on 12 Jul 2013
You can use the following commands to control the simulink model:
set_param(gcs,'SimulationCommand','Pause');
set_param(gcs,'SimulationCommand','Continue');
set_param(gcs,'SimulationCommand','Stop');
1 Comment
Luca Barbiero
on 12 Jul 2013
Categories
Find more on Get Started with Simulink in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!