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개)
madhan ravi
2020년 6월 27일
Please use a different name for "db", you're shadowing the inbuilt function db(...)
doc db
댓글 수: 5
Muneeb Ullah
2020년 6월 27일
madhan ravi
2020년 6월 27일
Is “dB.mat” in MATLAB’s path?
Muneeb Ullah
2020년 6월 27일
madhan ravi
2020년 6월 27일
Can you share it?
Muneeb Ullah
2020년 6월 27일
카테고리
도움말 센터 및 File Exchange에서 Call Web Services from MATLAB Using HTTP에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!