how to resolve error for code generation
13 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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.
0 comentarios
Respuestas (1)
Walter Roberson
el 14 de Jul. de 2018
S = load('NaiveBayes.mat');
nb = S.nb;
P_Class = predict(nb, A);
2 comentarios
Walter Roberson
el 15 de Jul. de 2018
It appears that it just is not supported. https://www.mathworks.com/help/simulink/ug/functions-supported-for-code-generation-categorical-list.html#btwz3ma
Ver también
Categorías
Más información sobre MATLAB Coder en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!