How to close Simulink model subsystems
9 次查看(过去 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!