Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

why is this code not working pls help me out

2 visualizaciones (últimos 30 días)
Hijab Zainab
Hijab Zainab el 12 de Oct. de 2018
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
function pushbutton1_Callback(hObject, eventdata, handles)
u=get(handles.popupmenu1,'Value');
v=get(handles.popupmenu1,'Value');
if u == 1 && v ==1
x_String = get(handles.edit1,'String');
x_numeric = str2num(x_String);
result = x_numeric*2;
result_String = num2str(result_numeric);
set(handles.text1,'String',result_String);
result_String = num2str(result_numeric);
set(handles.text1,'String',result_String);
elseif v == 2
%stuff here
elseif v == 3
%stuff here
end
  2 comentarios
Image Analyst
Image Analyst el 12 de Oct. de 2018
Other than duplicating the last two lines, what doesn't work about it? Do you have an error message? Or it just doesn't do what you want?
Hijab Zainab
Hijab Zainab el 12 de Oct. de 2018
Editada: Hijab Zainab el 12 de Oct. de 2018
Error in @(hObject,eventdata)untitled1('pushbutton1_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating UIControl Callback
can u pls help me with the alternative code if im doing something wrong

Respuestas (1)

OCDER
OCDER el 12 de Oct. de 2018
Wild solution guess:
Do not start the GUI by double-clicking the .fig file. Instead, start the GUI by running the .m file.

La pregunta está cerrada.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by