How to close Simulink model subsystems
Ältere Kommentare anzeigen
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.
Antworten (5)
TAB
am 14 Mär. 2012
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'));
Honglei Chen
am 13 Mär. 2012
doc bdclose
doc close_system
Doug Eastman
am 13 Mär. 2012
Assuming your top-level model is called TopModel you could use:
a = find_system('Parent','TopModel');
close_system(a)
Noam G
am 14 Mär. 2012
Pablo Romero
am 14 Sep. 2015
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.
Kategorien
Mehr zu Programmatic Model Editing finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!