Classificationlearner model doesn't run on Simulink
Informazioni
Questa domanda è chiusa. Riaprila per modificarla o per rispondere.
Mostra commenti meno recenti
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
Risposte (0)
Questa domanda è chiusa.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!