Classificationlearner model doesn't run on Simulink
Información
La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.
Mostrar comentarios más antiguos
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
Respuestas (0)
La pregunta está cerrada.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!