How to replace a block in Simulink?

조회 수: 4 (최근 30일)
Hugo
Hugo 2013년 7월 12일
Thank you for taking care in reading these lines, for helping and for taking time to answer.
I would like to know if there is a way to replace a block by another in the simulink window??? For example something like dragging a block and laying it on another block to replace it.
(I don't want to use replace_block('sys', 'old_blk', 'new_blk'))

답변 (1개)

Kaustubha Govind
Kaustubha Govind 2013년 7월 12일
You'll need to use a combination of add_block, delete_block, add_line and delete_line to do what you need.
As described in the documentation for add_block, you can create a copy of a block in the same model, using something like:
open_system('vdp');
block = add_block('vdp/Mu', 'vdp/Mu', 'MakeNameUnique', 'on')

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by