- find_system(), 'blocktype','inport' to find the Inport and Outport blocks.
- get_param() to get the Inport and Outport block names
- add_block() to add Goto and From blocks
- add_line() to connect
how to add goto from block and connected to the ports of a existed simulink system programmtically
13 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
wenchao zhang
am 1 Jul. 2024
Kommentiert: Fangjun Jiang
am 1 Jul. 2024
hello,i have a simulink subsystem with some port defined inside, for example it has two inports and two outports,now i want add from block and connected to the inport,add goto block and connect to the outport,both goto block and from block should be named same as the connected port,how to do this?
0 Kommentare
Akzeptierte Antwort
Fangjun Jiang
am 1 Jul. 2024
2 Kommentare
Fangjun Jiang
am 1 Jul. 2024
Yes. The position can be specified when add_block(). Or you can use set_param() separately.
The port position of the subsystem block that contains the Inport and Outport blocks can be used to determine the positions of the Goto and From blocks.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Programmatic Model Editing finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!