- Assign a unique tag to GUI2. This can be done by opening GUI2 in GUIDE, right click on the GUI background, select 'property inspector', and then assign a unique string in the "Tag" property.
- From GUI1, find the handle to GUI2 using: h = findobj(0, 'tag', 'UNIQUE_TAG'); where "UNIQUE_TAG" is the tag you assigned.
- Now get the handle to all of GUI2 components by using: handlesGUI2 = guidata(h);
- Now you have access to GUI2 from GUI1.
h = findobj(0, 'tag', 'UNIQUE_TAG');
handlesGUI2 = guidata(h);
You should also write a conditional that throws an error when 'h' is empty (meaning that GUI2 could not be found) or if numel(h)>1 (meaning your tag was not unique enough or you have >1 instances of GUI2 open).
Best Answer