Error while evaluating UIControl Callback.

조회 수: 17 (최근 30일)
Samuel Crofts
Samuel Crofts 2018년 12월 28일
댓글: Samuel Crofts 2018년 12월 28일
Hi there, my push button code does not work, it is almost identical to the code of a different pushbutton which is just to open a different GUI.
% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
run game.m
% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
run howtoplay.m
Error in
matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)attempt2('pushbutton1_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating UIControl Callback.
Pushbutton2 works, pushbutton1 does not.
  댓글 수: 4
Jan
Jan 2018년 12월 28일
Accepting an answer means, that your problem is solved. Is this correct?
Samuel Crofts
Samuel Crofts 2018년 12월 28일
Yes it is, thank you for your help

댓글을 달려면 로그인하십시오.

채택된 답변

Stephen23
Stephen23 2018년 12월 28일
편집: Stephen23 2018년 12월 28일
  댓글 수: 2
Samuel Crofts
Samuel Crofts 2018년 12월 28일
Thank you for your help,
Why does pushbutton 2 run correctly?
I would avoide using GUIDE if it wasn't just one university project i have to do, as my course is not programming based, and this is my only programming module, i want to do this project as easily as i can, and the lecturer recommended using GUIDE
Stephen23
Stephen23 2018년 12월 28일
"Why does pushbutton 2 run correctly?"
Because the code inside does not throw an error. Presumably howtoplay.m is a script on the MATLAB search path.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by