フィルターのクリア

Opening Model Default Behavior

2 ビュー (過去 30 日間)
RIchard
RIchard 2023 年 5 月 10 日
コメント済み: RIchard 2023 年 5 月 15 日
Is there a way to change the default behavior to "open as top model" for any referenced model (as opposed to a subsystem)? I have found that some key variables in the referenced model are not being displayed correctly because it is inheriting the parent model, instead of reading the reference model's value.

回答 (1 件)

Sarthak
Sarthak 2023 年 5 月 15 日
Hi Richard,
As per my understanding, Reference Model's callbacks should be able to handle such situations. In a model hierarchy, the execution of callbacks reflects the order in which the top model and the models it references execute their callbacks. You can leverage this to create variables in your desired order.
Like OpenFcn is a block and model callback. So potentially one could change the Model block, so that if a Model Reference file is specified, the OpenFcn could check if a model is specified and if yes, it could then directly open the mdl file of the referenced model. If no mdl reference is specified it would open the "normal" mask:
Attaching documentation links for your reference
  1 件のコメント
RIchard
RIchard 2023 年 5 月 15 日
So if I understand your comment correctly, the short answer is "No, there is no native option for this" while the longer one is to "make a callback function to do it".

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeCreate Large-Scale Model Components についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by