Unable to add block in Simulink 2016 with add_block command
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
stozaki
2020-7-31
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
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Subsystems 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!