delete Simulink(ex-sum) block and connect inport block to a bus using MATLAB coding

조회 수: 2 (최근 30일)
Hello All,
I am currently new to matlab coding and I am trying to write a script to programatically delete the summation block and constant block, the lines connecting constant block to sum block and sum block to bus and then connect the inport 3 to the bus creator. Can someone please suggest an idea on how to approach this. Also would really appreciate if you provide some examples or matlab commands that I can use for reference. Please let me know.

채택된 답변

Fangjun Jiang
Fangjun Jiang 2022년 6월 2일
Something like this. You can follow the document of these functions.
pSumBlock='PathToSumBlock';
hLine=get_param(pSumBlock,'LineHandles')
delete_line(h)
delete_block(pSumBlock)
delete_block('PathtoConstantBlock')
add_line()

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by