Why can't I find a 'Stateflow.EMChart' behind a masked library block?
조회 수: 3 (최근 30일)
이전 댓글 표시
MathWorks Support Team
2022년 12월 8일
답변: MathWorks Support Team
2023년 1월 26일
I have a model and a custom library. The custom library contains a masked subsystem, within which is a 'MATLAB Function Block'. I have placed an instance of the masked subsystem into my main model.
Before I moved the masked subsystem into the library, I used the following command to get the 'MATLAB Function Block' as a 'Stateflow.EMChart':
block = find(get_param(block_name, "Object"), '-isa', 'Stateflow.EMChart');
But now that I am using the masked subsystem as a library block, the above command returns an empty cell array. To get a value again, I have to first call
set_param(gcb,'LinkStatus','none');
to disable the masked subsystem's library link.
Disabling the library link is not ideal. Is there a way I can find the 'Stateflow.EMChart' without disabling the link?
채택된 답변
MathWorks Support Team
2022년 12월 8일
Disabling the link status of the library block is the only way to access the 'Stateflow.EMChart' of the 'MATLAB Function Block' with this configuration of blocks.
In general, accessing a 'Stateflow.EMChart' behind a mask is not a recommended practice as it goes against model-based-design principles. Instead, it is recommended to use 'Variant Systems' to accomplish the behavior you have described.
You can learn more about 'Variant Systems' at the link below:
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Subsystems에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!