Info

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

Attempt to reference field of non-structure array

1 visualización (últimos 30 días)
Jeevan
Jeevan el 6 de Mayo de 2014
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
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 comentario
Geoff Hayes
Geoff Hayes el 6 de Mayo de 2014
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?

Respuestas (0)

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