MATLAB: Can I automatically convert a function from MATLAB or a toolbox into c++ code

code generationImage Processing ToolboxMATLABMATLAB Compiler

I did some image processing using matlab. Now I am re-writing my matlab code into to c++.
For some of the parts in my matlab code, I use built in MATLAB functions (from the image processing toolbox)such as bwlabel, regionprops, etc. My question is it possible to convert these functions into c++ code. Perhaps using mcc?
Is there any other technique to do so would be of great great help as I believe wriitng the c++ code of such continuos from scratch is a huge task it self.

Best Answer

You can use Embedded MATLAB to generate C/C++ code, provided that you restrict yourself to using the Embedded MATLAB Subset.
Note that you will need to have a license of Simulink, Real-Time Workshop and probably also Real-Time Workshop Embedded Coder (for the C++ part). As far as I know, it only generates encapsulated C++, i.e. no classes. For more info see the documentation on Converting MATLAB Code to C/C++ Code.
You may want to contact MathWorks for more information.
HTH,
Arnaud