Is it possible to generate a variable number of Simulink blocks?
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposte (1)
Zack Peters
il 25 Ott 2013
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 Commenti
Vedere anche
Categorie
Scopri di più su Schedule Model Components in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!