How to close all windows except top level window of a model?

3 次查看(过去 30 天)
Hi,
I want to close all open windows except the top level window of a model. Model is opened using open_system command. e.g. I am opening say model name open_system('xyz') then it opens with three windows open lik xyz\abc, xyz\abc\pqr, xyz\lmn ,along with xyz , the top level window. Now I want to close all these three windows & want to keep open only xyz which is top level window. also before closing I want to save it so that next time when I will open the model xyz, it will open with only xyz open & not any other window open. I tried using bdclose , close_ system it did not work.
Please suggest the solution. Expecting reply, Thanks in advance !!
Sameer .

采纳的回答

Fangjun Jiang
Fangjun Jiang 2011-12-8
You can do this:
b=find_system(ModelName,'blocktype','SubSystem');
close_system(b);
This will only close those opened model windows and won't save the model. You can then save the model and next time you open the model, it will only show the root level window.
Another suggestion is to use the model browser window to browser your model, instead of double clicking every subsystem block to open it.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Programmatic Model Editing 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by