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

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);
Answers (1)
madhan ravi
on 27 Jun 2020
Please use a different name for "db", you're shadowing the inbuilt function db(...)
doc db
5 Comments
Muneeb Ullah
on 27 Jun 2020
madhan ravi
on 27 Jun 2020
Is “dB.mat” in MATLAB’s path?
Muneeb Ullah
on 27 Jun 2020
madhan ravi
on 27 Jun 2020
Can you share it?
Muneeb Ullah
on 27 Jun 2020
Categories
Find more on Call Web Services from MATLAB Using HTTP in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!