I save my adaboot model as .mat file. I use this to load the model:
load('adaboost_23.mat')
But matlab coder cannot generate C/C++ code. So I change to:
coder.load('adaboost_23.mat')
Still not working:
How should I do it? Data type is ClassificationEnsemble
.
Now I know. According to matlab guidance, you have to compact model first.
mdl = load('train_model.mat');
saveLearnerForCoder(mdl, 'compacted_model');
And load model.
cpt = loadLearnerForCoder('compacted_model');
After that, Coder will hard code your model and you will get your model in cpp file.