MATLAB: How to generate c++ static library from matlab code
cmatlab coderMATLAB Compilerstatic library
hi,
is it possible to generate c++ static library from matlab code. If so how.
Thanks
Best Answer
Assuming that you are only using thesubset of the MATLAB language that is supported for code-generation, you can generate a static library using theMATLAB Coder product.
If you can make do with DLLs/shared libraries, another option isMATLAB Compiler which supports most MATLAB functionality, but generates code that depends on some MATLAB run-time libraries, which requires that you install theMATLAB Compiler Runtime package on every machine that the library is deployed on.
The dll generated by MATLAB Coder is able to run without MATLAB Runtime, so it is deployable in such as embedded hardware which don't have much spec as PC nor servers. But MATLAB functions which can be converted to dll by MATLAB Coder are limited.
In the other hand, dll generated by libraryCompiler (a tool of MATLAB Compiler SDK) needs MATLAB Runtime (for free) in order to run. MATLAB Runtime requiresthe same machine specs as MATLAB, so the dll would only work on PCs and servers, not on embedded systems.
For detail of comparison between MATLAB Coder and MATLAB Compiler SDK, please seethis answer.
Best Answer