Running sequential simulations in a simulink model
8 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
Ryan G
2012-8-21
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 个评论
K E
2012-8-21
编辑:K E
2012-8-21
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).
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Event Functions 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!