Unable to add block in Simulink 2016 with add_block command

1 visualización (últimos 30 días)
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');

Respuesta aceptada

stozaki
stozaki el 31 de Jul. de 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

Más respuestas (0)

Etiquetas

Productos


Versión

R2016b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by