I translated my MATLAB code to C++ using MATLAB Coder and I changed the main.cpp to create a executable. Everything seems ok until here, but when I print my predict output, my classname has an extra character. How can I solve this situation? Classes are virginica and versicolor. When I run my program in command line, output is something like this: versicolorÌ
What am I doing wrong?
MATLAB Entry-Function
function output_lab = testMod(input_data)
Mod = loadCompactModel('model');
output_lab = predict(Mod, input_data);
end
GENERATED CODE
int main(int argc, const char * const argv[])
{
double input_data[4];
cell_wrap_0 output_lab[1];
for (int contador = 0; contador < 4; contador++)
{
input_data[contador] = atof(argv[contador + 1]);
printf("%f ", input_data[contador]);
}
printf("\n");
testMod_initialize();
testMod( input_data, output_lab);
cout << output_lab[0].f1.data;
getchar();
return 0;
}