Undefined operator '<=' for input arguments of type 'struct'.

2 visualizaciones (últimos 30 días)
narfiana lestari
narfiana lestari el 25 de En. de 2021
Editada: Matt J el 25 de En. de 2021
I want to retrieve data from the table and I will make an if else statement. Please help me
matriks_fitur = arrayfun(@num2str, handles.matriks_fitur, 'un', 0);
a = (strcmp(matriks_fitur, 'fitur_spasi'));
b= get(handles.TableFitur);
if b <=18
hasil = 'Extrovert';
elseif b == 42.5000
hasil = 'Introvert';
else
hasil = 'Empaty';
end
set(handles.targetkelas,'String',[num2str(hasil)]);
I get an error message as follows
Undefined operator '<=' for input arguments of type 'struct'.
Error in pelatihan_data>Target_Callback (line 1897)
if b <=18
Error in gui_mainfcn (line 95)
feval(varargin{:});
Error in pelatihan_data (line 42)
gui_mainfcn(gui_State, varargin{:});
Error in
matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)pelatihan_data('Target_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating UIControl Callback.
if anyone has any suggestions and can help me then i am very grateful

Respuesta aceptada

Matt J
Matt J el 25 de En. de 2021
Editada: Matt J el 25 de En. de 2021
It would appear that
b= get(handles.TableFitur);
has set b to a structure variable, whereas you expected it to be a scalar number.
  2 comentarios
narfiana lestari
narfiana lestari el 25 de En. de 2021
So, what should I do? Can you help me?
Matt J
Matt J el 25 de En. de 2021
Editada: Matt J el 25 de En. de 2021
You have to examine the contents of handles.TableFitur and see if it contains what you intended. If not, you have to determine how the wrong thing got there.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Introduction to Installation and Licensing en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by