How to load a trained classifier model inside Simulink MATLAB function in MATLAB 2015a?
이전 댓글 표시
Hi,
I have trained a classifier for my dataset in MATLB 2022a and saved it as a mat file (classifiername.mat). I need to load this classifier model inside Simulink Matlab function (MATLAb 2015a) and then use predict() to do prediction for my new data set. When I use these commanda in command window or m.file (not inside Simulink) of MATLAB 2015a
load classifiername.mat
[label] = predict(classifiername,XTest);
It load the classider as an object and everything works well, But I need to do all of these steps in Simulink which doesn't work.

function label = svmIonospherePredict(XTest)
load classifiername.mat ;
[label] = predict(classifiername,XTest);
end
This is the error:
The output of a call to 'load' is not assigned to a variable. Assign its output to a variable without subscripting.
Function 'MATLAB Function' (#35.570.591), line 11, column 1:
"load('classifiername.mat')"
Launch diagnostic report.
when I load the classifier to a variable, it change its format to structure and then I cannot use the model inside the predict () function.
I would be thankful for any help.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Deep Learning with Simulink에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

