error using list box, please help!!!
이전 댓글 표시
my gui has a listbox1.
the list box has 2 (values).
for each values i have two different numbers, and i want to change the string and the handle of a edit text (edit1).
when i run the gui and click for the first time on the listbox every thing is OK.....but when i click for the second time appears the following error :
??? Error using ==> set
Invalid handle object.
Error in ==> GUI>listbox1_Callback at 110
set(handles.edit1,'String',X)
Error in ==> gui_mainfcn at 96
feval(varargin{:});
Error in ==> GUI at 42
gui_mainfcn(gui_State, varargin{:});
Error in ==>
@(hObject,eventdata)GUI('listbox1_Callback',hObject,eventdata,guidata(hObject))
??? Error while evaluating uicontrol Callback
________________________
here is my code:::
function listbox1_Callback(hObject, eventdata, handles)
Z=get(hObject,'value')
if Z==1
X=120;
elseif Z==2
X=240;
end
set(handles.edit1,'String',X)
handles.edit1=X
guidata(hObject,handles)
___________
thank for helping my solving this issue.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Desktop에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!