Predict function doesn't work in standalone Matlab application

조회 수: 6 (최근 30일)
Morteza
Morteza 2020년 7월 22일
댓글: Morteza 2020년 7월 22일
I have a code which uses both neural network and TreeBagger. I use nn(x) to calculate neural network output for given x. Also I use predict(TB,x) function to calculate the output of TreeBagger for given x. I made an application for above code which works very good. But, when I construct an standalone application, and run it, it makes error that bad use of predict. I guess that I must include machine learning toolbox to my app, or, I must use another approach to calculate predict(TB,x).
The app has No problem with nn (because it doesn't use predict), just error for TreeBagger and predict function.
I use MATLAB 2016b Application Compiler.

채택된 답변

Steven Lord
Steven Lord 2020년 7월 22일
My suspicion is that you're bringing the TreeBagger object into your application by calling load on a MAT-file containing the object. Is that correct? If it is, see the Tip in the Fixing Callback Problems: Missing Functions section on this documentation page. Tell MATLAB Compiler that it needs to include the TreeBagger class in the standalone application using the option or the pragma listed in that section of that page.
  댓글 수: 3
Steven Lord
Steven Lord 2020년 7월 22일
I believe adding this line to your code would tell MATLAB Compiler to include TreeBagger in the application:
%#function TreeBagger
Morteza
Morteza 2020년 7월 22일
Dear Steven Thank you for your reply. That was very helpful. It works perfectly.
All the best

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

추가 답변 (0개)

카테고리

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

제품


릴리스

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by