MATLAB: Pass data from figure to main GUIDE pushbutton callback function

callbackfigurefunctionguiguidepass data

I created a pushbutton in main gui using guide and also programmatically created a figure with pushbutton which inputs data. How can I pass the data when the pushbutton is press from the figure and send it to the main gui pushbutton callback function? I have attached an image for clarification.

Best Answer

You need to update the hObject handle using,
guidata(hObject,handles);
Upon edit, save the new table data in this handle,
hObject.TableData = get(uitableHandle,'Data');
and then in the pushbutton callback use it like,
plot(hObject.TableData)