- Write MEX-files for your C++ code to create functions that can be called directly in MATLAB
- Write C wrappers around your C++ code for use with MATLAB's LOADLIBRARY to load the library in MATLAB and make its functions accessible using CALLIB
- MATLAB Compiler can deploy most MATLAB code , including MATLAB Classes. However, it does not accept a class as a top-level wrapper. For your shared library, you'd need to write functions that instantiate the class and call methods, and then you'd bundle these functions as your library.
- MATLAB Coder actually translates MATLAB code to C/C++ (unlike MATLAB Compiler, which bundles and encrypts it) and has stricter language limitations. MATLAB Coder allows MATLAB Classes but disallows other constructs you may be using such as cell arrays and try/catch. See here for supported and limited functionality.
- MATLAB Engine works by running MATLAB as its own background process, and the C interface allows you to execute arbitrary commands in it and access the workspace
- Is it preferred to use MATLAB or a C++ program as the driver? (If MATLAB, I'd suggest using MEX)
- If you are using a C++ program as the driver, do you have access to installed MATLAB on the machines where it will be run? (If you have access, I'd suggest MATLAB Engine)