Classification Learner - Call trained model in Simulink

6 Ansichten (letzte 30 Tage)
William Seldon
William Seldon am 26 Jul. 2017
Kommentiert: William Seldon am 26 Jul. 2017
Used classification learner to make a model, it exports the model as a function handle. When I try to call the function from a Matlab Function block in simulink it errors out. "Undefined function or variable 'trainedModel'" The variable trainedModle is loaded in the workspace.
function Value = Predictions(x)
Value = trainedModel.predictFcn(x);
  1 Kommentar
William Seldon
William Seldon am 26 Jul. 2017
Got it. Made a .m file with a simple function calling the model.
function y = fcn(x) coder.extrinsic('MyComplexTree'); y=zeros(1); y = MyComplexTree(x);

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by