Classification Learner - Call trained model in Simulink

조회 수: 6 (최근 30일)
William Seldon
William Seldon 2017년 7월 26일
댓글: William Seldon 2017년 7월 26일
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
William Seldon
William Seldon 2017년 7월 26일
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);

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Classification Learner App에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by