How can i call teh TrainedModel PredictFcn from Simulink

3 vues (au cours des 30 derniers jours)
Tugce Anliak
Tugce Anliak le 9 Juil 2019
Commenté : Robert Kaiser le 28 Juil 2020
Hi i have an issue with a regressionlearner Model that i trained with the App --> saved Model or compact model and try to use MatlabFunction in Simulink and get Errors.
function y = fcn(x1,x2,x3,x4,x5)
y = trainedModel08072019.predictFcn(x1,x2,x3,x4,x5);
This is the Error I get from Matlab:
Undefined function or variable 'trainedModel08072019'.
Function 'MATLAB Function' (#128.38.58), line 3, column 5:
"trainedModel08072019"
Launch diagnostic report.
Component:MATLAB Function | Category:Coder error
Errors occurred during parsing of MATLAB function 'TrainedModel_test/MATLAB Function'
Component:MATLAB Function | Category:Coder error
Simulink cannot determine sizes and/or types of the outputs for block 'TrainedModel_test/MATLAB Function' due to errors in the block body, or limitations of the underlying analysis. The errors might be inaccurate. Fix the indicated errors, or explicitly specify sizes and/or types for all block outputs.
Component:MATLAB Function | Category:Coder error
Simulink cannot determine sizes and/or types of the outputs for block 'TrainedModel_test/MATLAB Function' due to errors in the block body, or limitations of the underlying analysis. The errors might be inaccurate. Fix the indicated errors, or explicitly specify sizes and/or types for all block outputs.
Component:Simulink | Category:Model error
Error occurred in 'TrainedModel_test/MATLAB Function'.
Component:Simulink | Category:Model error
How is the correct form to call a simulink function
  1 commentaire
Robert Kaiser
Robert Kaiser le 28 Juil 2020
Hi Tugce,
I have a similar problem for the implementation of an exported trainedClassifier in Simulink.
Have you been able to solve the issue?

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Startup and Shutdown dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by