Simulinkモデ​ルのすべてのタブをプ​ログラム的に開閉する​にはどうすればいいで​すか?

Simulinkモデルの "open_system" と "load_system" コマンドを使って、Simulinkモデルのすべてのタブ(メインモデルウィンドウのみ開いた状態)をプログラム的に開閉するにはどうすればいいですか?

 Réponse acceptée

MathWorks Support Team
MathWorks Support Team le 29 Jan 2026

0 votes

"load_system"関数は、以前に開いたサブシステムやモデルタブを開かずにSimulinkモデルを読み込みます。
>> sys = load_system('<model>');
>> set_param(sys, 'Open', 'on');
現在開いているモデルのサブシステムまたはモデルタブを閉じるには、以下のコマンドを実行します。
>> sys_name = '<model>';
>> sys = find_system(sys_name);
>> subsys = find_system(sys,'BlockType','SubSystem');
>> close_system(subsys);
>> [mdl,~] = find_mdlrefs(sys_name);
>> idx = (strcmp(mdl,sys_name)~=1);
>> close_system(mdl(idx));

Plus de réponses (0)

Catégories

En savoir plus sur プログラムによるモデル編集 dans Centre d'aide et File Exchange

Produits

Version

R2021a

Tags

Aucun tag saisi pour le moment.

Community Treasure Hunt

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

Start Hunting!