フィルターのクリア

How to change default action of a subsystem?

2 ビュー (過去 30 日間)
Mel
Mel 2014 年 6 月 11 日
コメント済み: Mel 2014 年 6 月 11 日
Hi,
I have a model with several subsystems, each with a several scopes. The default action of double clicking on the subsystem is to open the subsystem to view the blocks inside.
However, I would like to change the default action to opening the scopes inside by using the code:
open_system('Model/Subsystem/Scope')
This is similar to all the example codes with Simulink, where double-clicking on the "?" button the documentation of that model opens.
Thank you!

採用された回答

Titus Edelhofer
Titus Edelhofer 2014 年 6 月 11 日
Hi,
do the following:
  • Right click on the block, select "Properties".
  • Select the callbacks tab.
  • Click on OpenFcn
  • Enter your code, maybe change to e.g.
open_system([bdroot '/Subsystem/Scope'])
in case someone would like to rename the model. Or use gcs/gcb appropriately.
Titus
  2 件のコメント
Ilham Hardy
Ilham Hardy 2014 年 6 月 11 日
Faster hands :)
Mel
Mel 2014 年 6 月 11 日
Works perfectly, thank you!!

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

その他の回答 (1 件)

Ilham Hardy
Ilham Hardy 2014 年 6 月 11 日
Perhaps something like this?
open_system([gcb '/Scope'])
Put it in your submodel OpenFcn callback. (Right click->properties->callback->OpenFcn)
  1 件のコメント
Mel
Mel 2014 年 6 月 11 日
Thanks!

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

カテゴリ

Help Center および File ExchangeSimulink Functions についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by