Is it possible to use "add_line()" betwen "Model Reference" Blocks

조회 수: 2 (최근 30일)
Lucas S
Lucas S 2019년 6월 26일
댓글: Arvind Sathyanarayanan 2019년 6월 28일
Hello !
I have a System with several "Model Reference" Blocks which have many in and out ports and i'm trying to connect each outport with its same name inport.
But when i try :
add_line(system, Model Name/Outport Name, Model Name/Inport Name);
it returns me an error.
How can i do this ?
Capture.PNG
Thanks for helping !

답변 (1개)

Arvind Sathyanarayanan
Arvind Sathyanarayanan 2019년 6월 26일
편집: Arvind Sathyanarayanan 2019년 6월 27일
Lucas,
Your command should be:
%Syntax: add_line('system_name', 'blockname/outport', 'blockname/inport');
add_line(gcs, 'Model/1','Model1/1');
  댓글 수: 6
Lucas S
Lucas S 2019년 6월 27일
Arvind Sathyanarayanan I don't understand why when i do :
find_system('Subsystem Name', 'BlockType', 'Inport');
i can have all ports of the subsystem blocks, but when i do :
find_system('Model Reference Name', 'BlockType', 'Inport');
I have nothing
Arvind Sathyanarayanan
Arvind Sathyanarayanan 2019년 6월 28일
Can you please post of a screenshot of your actual model so I can better understand what you're trying to do?
Regarding your second comment, you need to load the system before you can use api commands. Try:
load_system('Model Reference Name');
find_system('Model Reference Name', 'BlockType', 'Inport');

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Subsystems에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by