MATLAB: Is there a command to close all the tabs

programming,simulinktap

Is there a command to close all the tabs? I want to only hold the active one,and close all others,is any script can do this?

Best Answer

Starting from gcs, you can do this. The tab for the root level model would be kept open. The tabs for other models are also not closed.
a=find_system(bdroot(gcs),'FindAll',1,'BlockType','SubSystem');
b=setdiff(a,get_param(gcs,'handle'));
bdclose(b);