Why can't I add a block to my model using add_block?
12 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I want to add a block in a Simulink model named myModel.mdl. When I open the model and attempt to add a block using the following code:
open myModel.mdl
add_block('simulink/Sources/In1','myModel/myin1')
I sometimes receive the following error:
??? There is no block named 'simulink/Sources/In1'
Risposta accettata
MathWorks Support Team
il 27 Giu 2009
The Simulink library must be loaded to programmatically add blocks in a model. The LOAD_SYSTEM function can be used to programmatically load the Simulink library as in this example:
load_system('simulink')
open myModel.mdl
add_block('simulink/Sources/In1','myModel/myin1')
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Event Functions in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!