Invalid syntax for calling function 'db' on the path. CAN SOMEBODY HELP ME WITH THIS ERROR :(

7 visualizaciones (últimos 30 días)
function pushbutton4_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
im = handles.imdata1;
%% Find the class the test image belongs
Ftest=FeatureStatistical(im);
%% Compare with the feature of training image in the database
load 'db.mat'
Ftrain=db(:,1:2);
Ctrain=db(:,3);
for (i=1:size(Ftrain,1))
dist(i,:)=sum(abs(Ftrain(i,:)-Ftest));
end
m=find(dist==min(dist),1);
det_class=Ctrain(m);
if det_class == 1
R1 = 'Japanese Beetles';
set(handles.edit1,'string',R1);
% helpdlg(' Japanese Beetles ');
% disp(' Japanese Beetles ');
elseif det_class == 2
R2 = 'Whitefly';
set(handles.edit1,'string',R2);
% helpdlg(' Whitefly ');
% disp('Whitefly');
elseif det_class == 3
R3 = 'Stink Bug';
set(handles.edit1,'string',R3);
% helpdlg(' Stink Bug ');
% disp(' Stink Bug ');
elseif det_class == 4
R4 = 'Winter Mouth';
set(handles.edit1,'string',R4);
% helpdlg(' Winter Mouth ');
% disp('Winter Mouth');
% end
% Update GUI
end
guidata(hObject,handles);

Respuestas (1)

madhan ravi
madhan ravi el 27 de Jun. de 2020
Please use a different name for "db", you're shadowing the inbuilt function db(...)
doc db
  5 comentarios

Iniciar sesión para comentar.

Categorías

Más información sobre App Building en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by