How to add link from line to a Goto block using command

조회 수: 13 (최근 30일)
Varun Nayyar
Varun Nayyar 2022년 11월 28일
편집: madhan ravi 2024년 3월 7일
I have a model named (generic_cond)
I added a goto block like below:
temp = add_block('simulink/Signal Routing/Goto','generic_cond/LOAD1_LEVEL', 'GotoTag', 'LOAD1_LEVEL')
There is a signal line (LOAD1_LEVEL) which connects two blocks in my model. How do i add line to the new Goto block using command
Something like this does not work: add_line('generic_cond',LOAD1_LEVEL, temp);

채택된 답변

Pravarthana P
Pravarthana P 2022년 12월 1일
편집: madhan ravi 2024년 3월 7일
Hi Varun Nayyar,
I understand you are trying to add a signal line between two blocks, to Goto block programmatically.
The signal line can be connected to Goto block using ‘add_line’ function by specifying the port number of the desired blocks.
In this case to connect the signal line, the port number of the block from which the signal is originating can be used along with the port number of the Goto block.
For example, let Constant and Scope be the two blocks between which the LOAD1_LEVEL signal runs which you want to connect to Goto block:
>>add_line('generic_cond','Constant/1','Goto/1');
For more information, refer to the documentation link:
I hope this information helps you.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Programmatic Model Editing에 대해 자세히 알아보기

태그

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by