MATLAB: Set handles of another GUI

getting startedguiguidematlab gui

Hi,
Is there a way to set handles of another GUI? I have a main GUI which prompt a sub GUI. In the sub GUI,when a button is pressed and it will set the main GUI visible off.
set(handles.fig1,'Visible','off');
I place this code on the the button of my sub GUI. fig1 is the handles of my main GUI. However to code has error because the sub GUI doesnt know the handles fig1.

Best Answer

Set the Tag parameter for the main GUI's figure, and then in the sub-GUI
handles.fig1 = findobj(0,'Type','figure','Tag','TheTagYouSet');