Classificationlearner model doesn't run on Simulink
정보
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
이전 댓글 표시
I wasn't able to load a trained model into Simulink.
I used the Classificationlearner app which only produces a Matlab function.
The function works well in a Matlab script but doesn't compile in a Matlab function block running in Simulink.
The compile starts but then fills GB of memory over a few minutes.
Here is the function code:
function Case_Prediction = RunANN(Predictors)
persistent ANN
Case_Prediction = 0;%Tell Simulink the size of the output
Predictors = [0,0,0,0,0,0,0,0,0,0,0];
if isempty(ANN)
ANN = loadCompactModel('ANN.mat');%Load it only once
end
Case_Prediction = predict(ANN, Predictors);%Perform the prediction
end
In Simulink, the fucntion looks like this:

The compact structure looks like this:

What is wrong?
Thanks for your help.
Marco
댓글 수: 0
답변 (0개)
이 질문은 마감되었습니다.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!