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

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);

답변 (1개)

Please use a different name for "db", you're shadowing the inbuilt function db(...)
doc db

댓글 수: 5

Is “dB.mat” in MATLAB’s path?
yes it is in the same folder. :(

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Call Web Services from MATLAB Using HTTP에 대해 자세히 알아보기

태그

질문:

2020년 6월 27일

댓글:

2020년 6월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by