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!