how to resolve error for code generation

조회 수: 14 (최근 30일)
Hira Abid
Hira Abid 2018년 7월 14일
댓글: Walter Roberson 2018년 7월 15일
i have to convert my matlab code in C which will later used for my android application. i'm using matlab coder for conversion purpose. i'm getting error in following line
load NaiveBayes
P_Class = predict(nb,A);
the error is:
The output of a call to 'load' is not assigned to a variable . Assign its output to a variable without subscripting.
Undefined function or variable 'nb'.
when i make changes to code as:
S = load (NaiveBayes)
P_Class = predict(nb,A);
the error changes to this:
NaiveBayes is not supported for code generation.
predict is not supported for code generation.
please help me in this case as i genuinely need to convert it to C.

답변 (1개)

Walter Roberson
Walter Roberson 2018년 7월 14일
S = load('NaiveBayes.mat');
nb = S.nb;
P_Class = predict(nb, A);
  댓글 수: 2
Hira Abid
Hira Abid 2018년 7월 15일
thank you so much Walter!!! but i'm still getting error for following line:
P_Class = predict(nb,A);
as:
predict is not supported for code generation
please please help me !!!!

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

카테고리

Help CenterFile Exchange에서 MATLAB Coder에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by