Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

why is this code not working pls help me out

조회 수: 1 (최근 30일)
Hijab Zainab
Hijab Zainab 2018년 10월 12일
마감: MATLAB Answer Bot 2021년 8월 20일
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
Image Analyst
Image Analyst 2018년 10월 12일
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 2018년 10월 12일
편집: Hijab Zainab 2018년 10월 12일
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

답변 (1개)

OCDER
OCDER 2018년 10월 12일
Wild solution guess:
Do not start the GUI by double-clicking the .fig file. Instead, start the GUI by running the .m file.

Community Treasure Hunt

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

Start Hunting!

Translated by