Unrecognized function or variable 'classify' in APP DESIGNER

%This is how I load my .mat file
app.Lettuce_Net = load ('Lettuce_Net.mat');
app.Lettuce_Net = app.Lettuce_Net.Lettuce_Net;
handles.Lettuce_Net = app.Lettuce_Net;
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
%This is how I classify the uploaded Image
function classify_1_Callback(app, event)
% Create GUIDE-style callback args - Added by Migration Tool
[hObject, eventdata, handles] = convertToGUIDECallbackArguments(app, event); %#ok<ASGLU>
% hObject handle to classify_1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
app.Lettuce_Net = handles.Lettuce_Net;
handles = guidata(hObject);
b = handles.b;
b = imresize(b, [227, 227], 'nearest');
[YPred,scores] = classify(app.Lettuce_Net, b);
scores = max(double(scores*100));
set(handles.result,'string',join([string(YPred),'' ,scores ,'%']));
end

 Réponse acceptée

Image Analyst
Image Analyst le 25 Mai 2022
It seems you do not have the Deep Learning Toolbox or Statistics and Machine Learning Toolbox. What does this say:
>> ver
(erase your license number before posting your toolboxes). What do you see if you do this:
>> which -all classify
C:\Program Files\MATLAB\R2022a\toolbox\stats\stats\classify.m
C:\Program Files\MATLAB\R2022a\toolbox\nnet\cnn\@DAGNetwork\classify.m % DAGNetwork method
C:\Program Files\MATLAB\R2022a\toolbox\matlab\depfun\+matlab\+depfun\+internal\FileClassifier.m % matlab.depfun.internal.FileClassifier method

9 commentaires

@Image Analyst Problem is already resolved. Thank you so much sir for the help may God bless you and your family!
@Johann Sebastian Servas sorry if it inappropriate to ask..may I know how do you solve this problem because it same with my situation.
Johann Sebastian Servas
Johann Sebastian Servas le 13 Juin 2022
Modifié(e) : Johann Sebastian Servas le 13 Juin 2022
@Fatin Nasuha Bt Asrol Good day just install the deep learning toolbox and you’re good to go.
@Image Analyst May I ask, Is it will effect for my function classify in coding if I did not get the same result with you for the last sentences as below? I get econ not depfun. I always get the error for the function classify eventhough I already installed deep learning toolbox.
I will apreaciated if you can assist me to solve this problem. Thank you.
>>which classify -all
D:\Softwares\MATLAB\toolbox\stats\stats\classify.m
D:\Softwares\MATLAB\toolbox\nnet\cnn\@DAGNetwork\classify.m % DAGNetwork method
D:\Softwares\MATLAB\toolbox\econ\econ\@dtmc\classify.m % dtmc method
Image Analyst
Image Analyst le 14 Juin 2022
Modifié(e) : Image Analyst le 14 Juin 2022
@Fatin Nasuha Bt Asrol do you see the deep learning toolbox when you enter this
>> ver
You say "my function classify" so it is a custom function you wrote, or is it one of the MATLAB-supplied functions:
>> which -all classify
C:\Program Files\MATLAB\R2022a\toolbox\stats\stats\classify.m
C:\Program Files\MATLAB\R2022a\toolbox\matlab\depfun\+matlab\+depfun\+internal\FileClassifier.m % matlab.depfun.internal.FileClassifier method
C:\Program Files\MATLAB\R2022a\toolbox\nnet\cnn\@DAGNetwork\classify.m % DAGNetwork method
Methods of a class do not always show up for "which" unless the class is currently loaded.
What is class() of the first parameter of your call to classify() ?
@Fatin Nasuha Bt Asrol what is the exact error message. Tell us all the red text you see in the command window, including the lines of code, and line numbers, and the error message itself.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by