Forwarding Table delete a block

조회 수: 2 (최근 30일)
John D
John D 2019년 1월 9일
댓글: Fangjun Jiang 2019년 1월 10일
I have old models that contain a custom annotation block. Simulink has for some time supported much nicer annotation blocks so I my goal is to replace the old custom block with a native annotation using a forwarding table upgrade process.
I have succesfully created the forwarding table upgrade script that takes the text from the old annotation block and creates a new native annotation using Simulink.Annotation(.... ) of the same size and position.
The problem I have is that I now need to delete the old block. The delete_block() function cannot be used within the forwarding table upgrade script (within a callback).
So here are my questions:
  • Is there another way to schedule the deletion of a block during the forwarding table upgrade process ?
  • Is there a different method to convert a block to an annotation ?
Thanks
John
  댓글 수: 3
John D
John D 2019년 1월 10일
Hi Jiang
The problem is that the 'new block' is not a block but an annotation. In the past I have upgraded blocks but in this case I want to replace a block with an annotation.
To do this I can create an annotation but I cannot delete the old block.
John
Fangjun Jiang
Fangjun Jiang 2019년 1월 10일
Then don't use the forwarding table approach. Since you couldn't specify the "New Block Path" to point to the annotation, you probably did all the conversion in the "Transformation Function". Just put the same script in the "PostLoadFcn" callback of the model. It checks the existence of you old block, makes the conversion and you can use delete_block().

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

답변 (0개)

카테고리

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

제품


릴리스

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by