I am new to MATLAB GUI building and I am trying to learn how to pass data between two GUIs. My question is how to call a function in the main GUI from a sub GUI.
For example:
In the main GUI, I am getting the values from two text box from their respective callbacks as such:
handles.A= str2double(get(handles.textbox1,'string'));
guidata(hObject,handles)
handles.B = str2double(get(handles.textbox2,'string'));
guidata(hObject, handles)
then in addition to the above, I have a third function that does addition as such:
function addition(handles)
C= handles.A + handles.B
The third function however is being accessed from the sub GUI through a button push as follows:
function pushbutton1_Callback(hObject, eventdata, handles)
main_gui('addition');
The error I am getting is not enough input arguments in the line C = handles.A + handles.B
, but I don't know why I am getting this error. Can anyone help me?