Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
Attempt to reference field of non-structure array
조회 수: 1 (최근 30일)
이전 댓글 표시
i am trying to display the values obtained by a variable h_dist in the edit text field but it is showing me the below error
My code is set(handles.edit1,'String',num2str(h_dist1)); set(handles.edit2,'String',num2str(h_dist2)); set(handles.edit3,'String',num2str(h_dist3));
the error is
Attempt to reference field of non-structure array.
Error in LBPFeature>TestingLBP_Callback (line 268) set(handles.edit1,'String',num2str(h_dist1));
Error in gui_mainfcn (line 96) feval(varargin{:});
Error in LBPFeature (line 42) gui_mainfcn(gui_State, varargin{:});
Error in @(hObject,eventdata)LBPFeature('TestingLBP_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating uicontrol Callback
what do i do to display the values in the edit text box. im new to matlab so please help me
댓글 수: 1
Geoff Hayes
2014년 5월 6일
Which of the three lines is generating the error? Or is it some other line?
set(handles.edit1,'String',num2str(h_dist1)); set(handles.edit2,'String',num2str(h_dist2)); set(handles.edit3,'String',num2str(h_dist3));
The error message indicates that the code is trying to access a field (via the period) of a non-structure array. So in the above three lines of code, the potential error is due one of the three handles.edit1/2/3 accesses. You should put a breakpoint at the first of these three lines, and re-run the code until it pauses here. Look at the handles structures - does it have fields names edit1, edit2, and edit3? Is the structure empty? Are these the names of your edit boxes, or have their Tags changed?
답변 (0개)
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!