Is it possible to generate a variable number of Simulink blocks?
8 ビュー (過去 30 日間)
古いコメントを表示
Hi everyone,
I have a specific custom block in Simulink that I want to be able to generate dynamically upon loading the Simulink file/model. Right now I have to copy and paste it based on how many I want.
For example, if I want 10, I just copy and paste the block 10 times. If I want 30 of them, I copy and paste it 30 times.
However if I want 1000 then it becomes quite difficult to copy and paste it 1000 times. Also, each experiment I do I need a different number of this particular block.
What I would like to be able to do is pass a number like "5" or "6000" when I call the Simulink model and have it generate that many of the block I need.
Is this possible?
Thanks, and warmest regards,
Shawn
0 件のコメント
回答 (1 件)
Zack Peters
2013 年 10 月 25 日
Hi Shawn,
Simulink is equipped with command line functionality for model creation. After experimenting with it a bit, you should be able to create a script that can add n blocks to the model and connect them in various ways via the add_block and add_line command.
Here, you should be able to find all of the functions available for manipulating your model from the command line.
~Zack
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Programmatic Model Editing についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!