MATLAB: How to control GUI data from anther GUI

guideimage processingMATLABmatlab gui

By using GUIDE toolbox I have made two GUI in matlab. I want to control a image in an axes of GUI1 by using a slider GUI2. How is it possible? How can I pass the value of slider in GUI2 to axes of GUI2? Thanks

Best Answer

If the object from the other GUI has a unique Tag then you can findobj() based on the Tag . Or in case the object has only callback visibility then findall() instead of findobj(). GUIDE allows you to change the Tag of an object.
If the object does not have a unique Tag then you need a way of finding some graphics object that belongs to the other GUI -- such as if the first GUI passed its figure number to the second GUI when it started the second GUI. If you can find some graphics object from the other GUI then you can ancestor() to find its figure. Then you can call guidata() passing in that figure identifier, which will return back the handles structure that belongs to that GUI; you can then extract the appropriate handle from that handles structure.