Error while evaluating UIControl Callback.
Mostrar comentarios más antiguos
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 comentarios
Jan
el 28 de Dic. de 2018
Is this the complete error message? We see, where the problem occurred, but usually the message contains a hint also, what the error is. Maybe there is a typo inside game.m?
Prefer to use functions instead of scripts. Calling a script through run ... is less smart and prone to bugs.
Samuel Crofts
el 28 de Dic. de 2018
Jan
el 28 de Dic. de 2018
Accepting an answer means, that your problem is solved. Is this correct?
Samuel Crofts
el 28 de Dic. de 2018
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Interactive Control and Callbacks en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!