I want to build simple multiply function with GUI, but every time a got an error with it, with pushbottom

2 views (last 30 days)
function product_Callback(hObject, eventdata, handles)
x = str2double(get(handles.Input1, 'string'));
y = str2double(get(handles.Input2, 'string'));
multi = x*y;
set(handles.product, 'string', multi);
the error is ...........
Undefined function 'pushbutton1_Callback' for input arguments of type 'matlab.ui.control.UIControl'.
Error in gui_mainfcn (line 95)
feval(varargin{:});
Error in GUIIIIII21 (line 42)
gui_mainfcn(gui_State, varargin{:});
Error in
matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)GUIIIIII21('pushbutton1_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating UIControl Callback.

Accepted Answer

Walter Roberson
Walter Roberson on 27 May 2022
rename product_Callback to Pushbutton1_Callback
And next time use the facilities of Guide to rename controls so that it will automatically rename the references hidden inside the fig file.
  3 Comments

Sign in to comment.

More Answers (0)

Categories

Find more on Migrate GUIDE Apps in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!