How can I lock a block in Simulink?

조회 수: 4 (최근 30일)
Andrea
Andrea 2013년 7월 30일
I wrote my own library, with one S-Function Block in Simulink. I want that it is possible to insert the block once in a Simulink Model, but not a second time (in the same model). I want that the my block is unique in the model. I need the block for some settings. Is there a chance to do that?

채택된 답변

Andreas Goser
Andreas Goser 2013년 7월 30일
I suppose there is no way to present inserting the block a second time, but you can verify if more than one block of this type exists right before running the model. You would need to apply MATLAB code with e.g. the "find_system" command as a model callback .
  댓글 수: 3
Andrea
Andrea 2013년 7월 30일
With "find_system" I can see if there are more than one blocks. Is it possible to delete, or remove the second one?
Andreas Goser
Andreas Goser 2013년 7월 30일
Yes. There are more Simulink API commands. Here DELETE_BLOCK

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

추가 답변 (0개)

카테고리

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