Running sequential simulations in a simulink model
1 view (last 30 days)
Show older comments
I have a simulink model with a set of about 10 parameters. I also have a set of about 15 different sets of parameters, I am trying to design some form of script that will run the model on the first set of parameters, then the next, etc until it runs the last set of parameters and halts. However, I'm not really sure were to start with this, does anyone have any ideas?
0 Comments
Answers (1)
Ryan G
on 21 Aug 2012
It sounds like you are trying to do parameter sweeps. You can utilize functions such as set_param to change between runs and then utilize the sim command to run and collect data inside a for loop.
2 Comments
K E
on 21 Aug 2012
Edited: K E
on 21 Aug 2012
Oliver, there is an example of a parameter sweep at the very end of this tutorial. See also 'Simulating from the MATLAB Command Line' in this tutorial. You may want to use the function allcomb.m to generate all the combinations of parameters, for example if you want to run some parallel simulations, see here. If you have the Parallel Processing toolbox and want to speed up your parameter sweeps, note that you can't nest the loops, so allcomb may be useful. I wish Simulink had some kind of built-in GUIs to make running and saving output from extensive parameter sweeps easier for beginners (like me).
See Also
Categories
Find more on Event Functions 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!