How to close Simulink model subsystems
조회 수: 15 (최근 30일)
이전 댓글 표시
For a given model, I am looking for an easy way to close all open subsystems' windows, except the basic one. If I close them all, save the model and reopen it, it works, but I want to do the same with code.
답변 (5개)
TAB
2012년 3월 14일
No need of using lots of variables & loop. Just find all the subsystems in the model and close them.
close_system(find_system('YouModel','findall','on','BlockType','SubSystem'));
댓글 수: 0
Doug Eastman
2012년 3월 13일
Assuming your top-level model is called TopModel you could use:
a = find_system('Parent','TopModel');
close_system(a)
댓글 수: 0
Pablo Romero
2015년 9월 14일
There is a small trick. You can load again the top-level of the system and save it (if requested).
open_system(bdroot); % Load the top-level
close_system(bdroot, 1); % Save and close the Model
Of course you can use your Modelname instead of bdroot.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Programmatic Model Editing에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!