matlab GUIs

2 visualizzazioni (ultimi 30 giorni)
ammara AMMARA
ammara AMMARA il 25 Apr 2012
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?

Risposta accettata

Jakob Sørensen
Jakob Sørensen il 25 Apr 2012
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).

Più risposte (0)

Categorie

Scopri di più su Graphics Object Identification in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by