Clear Filters
Clear Filters

How do I use predict() on CompactCla​ssificatio​nNeuralNet​work and CompactCla​ssificatio​nEnsemble objects in 32 bit Matlab 2015b?

1 view (last 30 days)
I'm trying to use existing machine learning models to make predicitions based on sensor data in real time. Interfacing between the sensor and computer requires a 32 bit ADC, so the computer can use at best R2015b. I'm trying to find a way to perform the equivalent of
predict(model,data)
in R2015b. I thought to generate C/C++ code similarly to the "Generate C/C++ for Prediction" example in the LoadLearnerForCoder() documentation. However, since the C/C++ code must be generated on a 64 bit Matlab version, the mex file is 64 bit as well and can't be run in R2015b. Is there a way to tell LoadLearnerForCoder() to create a 32 bit mex file? Or is there a different approach I should take to getting an equivalent to predict() working in R2015b?

Answers (1)

Akshat Dalal
Akshat Dalal on 8 Oct 2023
Hi Walden,
I understand you want to use the ‘predict’ function in R2015b. You can create a 32-bit DLL for the function. You can then use the ‘loadlibrary’ function to load and use the functions from the generated DLL in R2015b.
You can refer the following MATLAB Answer on how to create a 32-bit DLL on a 64-bit MATLAB version - https://in.mathworks.com/matlabcentral/answers/497234
You can refer the following documentation to learn more about the ‘loadlibrary’ function - https://in.mathworks.com/help/matlab/ref/loadlibrary.html
Hope this helps!

Categories

Find more on MATLAB Coder in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!