Unrecognized function or variable 'classify' in APP DESIGNER

6 ビュー (過去 30 日間)
Johann Sebastian Servas
Johann Sebastian Servas 2022 年 5 月 25 日
コメント済み: Image Analyst 2022 年 6 月 15 日
%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

採用された回答

Image Analyst
Image Analyst 2022 年 5 月 25 日
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 件のコメント
Walter Roberson
Walter Roberson 2022 年 6 月 14 日
What is class() of the first parameter of your call to classify() ?
Image Analyst
Image Analyst 2022 年 6 月 15 日
@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.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGet Started with Statistics and Machine Learning Toolbox についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by