Transferred from: http://www.cnblogs.com/xlw1219/archive/2012/12/25/2832222.html
You must first know some of the command explanations that you need to know about joint programming:
The role of MCC is to compile. m files into a C/s + + dynamic-link library file, allowing you to use some of the functions of MATLAB in C + + programs. MCC can also compile the. m file as an EXE executable file.
The role of Mex is to compile the C/cpp file into a library file that can be called by the. m file, usually in the Windows operating system, with the extension of mexw32 or mexw64, allowing you to extend MATLAB using C/s + +, which is the ability to invoke C + + writing functions in MATLAB To add new functionality or to speed up the functionality of the original program.
The role of mbuild is to treat Matlab as a C + + compiler, using the mbuild to compile C/s + + as an EXE executable, which is characterized by the ability to invoke the math library and graphics library of MATLAB, but this requires the use of a dynamic connection library provided by Matlab to run.
Note: After I entered the MCC command, there was a problem with Test checkout of feature ' Compiler ' failed, because matlab2014a did not crack and was resolved according to the following link:
http://blog.csdn.net/smilebluesky/article/details/42987985
--------------------------------------Split Line-----------------------Gorgeous turn-------------------------------
When doing MATLAB and C + + mixed programming, you need to set up the system. For example, I want to use Deploytool to generate a C + + dynamic link library (pictured below), you must first run the Mbuild-setup command.
Note that I am using matlab2014a, different from the text, the specific Deploytool compilation process is as follows:
Command line Input deploytool: Select Application Compiler
Then, go to the following page, add the main executed. m file in the Add main file, and then add the auxiliary. m file in the Run application below, then click on the package to generate the EXE file.
After compiling, three folders are generated: Click the exe executable file under the For_testing folder to run.
Behind the work is very simple, a new C + + project, add the generated ImageConvert.exe to the project, write:
#include <windows.h>
int main ()
{
System ("ImageConvert.exe");
}
Run through at once.
C + + with MATLAB programming, call Deploytool generate EXE file and DLL file (GO)