Stuart’s MATLAB Videos

Watch and Learn

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the Original version of the page.

Using parent child relationships to find figures 6

Posted by Doug Hull,

This was a question that came across my desk recently: “How do I know what figure numbers are already open?” The way to answer this is to query the “root” (always handle 0) for its children. Figures are always children of the root and are the only direct children of the root. get(0, ‘children’) This video discusses the question in more depth and talks about the graphics family tree.

6 CommentsOldest to Newest

tomas replied on : 1 of 6
Hi Doug, thank you for your postings and videos. i really like them. i have now a question regarding this posting here. how can i get the handle into a variable? i identify the figure i need using get(0,'children') and then checking the name of the figure. now, if i know that my figure is the nr. 5 for example, how can i get the handle to it? handle = get(5); set(handle,'Name','test') returns an error. handle is in this case not the handle, but the structure of the properties of the figure. thank you very much, tom
Doug replied on : 2 of 6
Tomas, In the above case, 5 is the handle. When you GET it, you are actually losing the handle that you want. Look at his example. a = figure(1) handle = a notHandle = get(a) -Doug
khadija replied on : 3 of 6
thanks for the post. i'm a newbie to MATLAB. I have a very basic question. How can I bind a popupmenu to a uipanel using property inspector? thanks, khadija
khadija replied on : 5 of 6
I added a popupmenu to a uipanel. Now if want to keep the visible mode "off" for my panel, the popupmenu is still displayed. So i have to keep the visible mode "off" for my popupmenu separately. I want the popupmenu and the uipanel to act as one entity so that when I keep the visible mode "off" for the panel, the popupmenu should become invisible automatically. Is that possible? thanks, khadija
dhull replied on : 6 of 6
Khandija, Please contact technical support. I expect that if you configured everything correctly (using defaults) that if the popup menu were placed inside that panel it would keep the same visibility properties as you expect it should. When you send in the request, please include the relevant files and the reproduction steps. they will take a look at it. Doug