MATLAB: Convert C++ Code to Matlab Code with MATLAB 2019a

cc++ to matlabMATLABmatlab coderreverse codegen

I have large files that I would like to convert from C++ to Matlab code. Previous responses on MATLAB Answers indicate that this must be done manually, but is this still the case for the most recent version of MATLAB?

Best Answer

If your overall goal is to convert C++ code to MATLAB code, yes, manual conversion is still required in R2019a.
However, if you only need to call the C++ code from MATLAB, simpler solutions are possible (in older releases as well as R2019a):
Option A: create a MEX file via MATLAB Coder (using MATLAB Coder on a simple M file that just calls the C++ function using coder.cinclude and coder.ceval) - see the last comment on a similar question.
Option B: create a MEX file via the MEX command (you will need to write a MEX wrapper for the C++ code). More information can be found on this documentation page.