Previously mentioned in C + + call Matlab, is the MATLAB call C + + configuration to explain, at the same time give code examples
1. My environment is still (VS2010+MATLAB2010B)
2. Set up C + + compiler in MATLAB, use command (mex–setup), inside Select a compiler is according to the C + + compiler that you install to choose.
3. New C + + project, write C + + code (My code is very simple, mainly to illustrate the MATLAB call C + +), in C + + project to configure the MATLAB path (two bold lines), as follows:
4. C + + code is as follows:
5. MATLAB call after the operation results (first conversion to the path to be compiled CPP file, and then to compile the CPP file for MEX operations, such as Mex Add.cpp, the last direct use of C + + written functions, such as Add ():
6. Comparison of C + + operation results:
7. Problems may also occur in the configuration: computer lost Libmx.dll Error resolution
Reference: http://blog.csdn.net/chenkent888/article/details/17186169