In GUIs that are generate by GUIDE, every callback has 3 arguments:
- hObject: the handle to the object that generated the callback (e.g. a button). This can be retrieved with the gcbo as well.
- eventdata: this stores special data for some specific callbacks like key presses or scroll actions
- handles: the current contents of the data stored with the figure. This retrieved with guidata(hObject) at the time of the callback.
The guidata struct is very important, because GUIDE stores all handles to your elements there and it is the easiest way to share data between callbacks. Don't forget to store the modified struct back to figure (if you made any modification to the data). You can use guidata(hObject,handles) to do that.
A more thourough discussion about GUI design can be found here.