If you are trying to convert C++ code to MATLAB code, you have to do it manually.
But you can also call your C++ code from MATLAB without converting it. Look at this Matlab answer for a detailed procedure on how you can call C++ code from the MATLAB Code.