Classification Learner - Call trained model in Simulink

2 ビュー (過去 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 Center および File ExchangeClassification Learner App についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by