Unable to add block in Simulink 2016 with add_block command
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Ruhi Phulbandhe
le 30 Juil 2020
Commenté : Ruhi Phulbandhe
le 3 Août 2020
Hi , I'm getting an error when i try to add_block in 2016 MATLAB version with the command listed below
sys = 'Test';
new_system(sys) % Create the model
open_system(sys) % Open the model
% Start adding blocks; for each one the position has to be specified
add_block('built-in/SubSystem',[sys '/xyz'],'Position',[240 95 270 125]);
add_block('built-in/Inport', [sys '/xyz' '/IN1'],'Position',[240 95 270 125]);
add_block('built-in/Inport', ['/Test' '/IN1'],'Position',[140 95 170 125]);
add_line('Test','IN1/1','xyz/1', 'autorouting','on');
0 commentaires
Réponse acceptée
stozaki
le 31 Juil 2020
Hello Ruhi,
Please try to edit line 7 as follows :
Before :
add_block('built-in/Inport', ['/Test' '/IN1'],'Position',[140 95 170 125]);
After :
add_block('built-in/Inport', ['Test' '/IN1'],'Position',[140 95 170 125]);
or
add_block('built-in/Inport', [sys '/IN1'],'Position',[140 95 170 125]);
Regards,
stozaki
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Subsystems dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!