Running sequential simulations in a simulink model
9 ビュー (過去 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).
参考
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!