matlab GUIs

2 次查看(过去 30 天)
ammara AMMARA
ammara AMMARA 2012-4-25
I have a main GUI from which I can open several sub GUIs. I need to write a code such that when I open the sub GUIs, first sub GUI should be closed when I open the second sub GUI but the main GUI should remain open. Can anyone help me out with the code?

采纳的回答

Jakob Sørensen
Jakob Sørensen 2012-4-25
Hmm, maybe 'findobj' could work. I tried some code that seemed to work:
% Find all figures
list_of_figs = findobj('type','figure');
% The latest opened figure, should be in the end of the list.
sub_fig = list_of_figs(end);
% Close the figure
close(sub_fig);
Or you could open you sub GUI's using the same name for all of them (since you won't have more than one open at a time anyway), and then just use close(sub_fig_name).

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Graphics Object Identification 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by