1 . 准备好c++ 的执行文件.cpp 2. 在matlab的命令行中输入 mex - setup, 并选择 c++ 3. mex cpp文件名, 生成 mexw64 文件,可直接调用,文件名和 .cpp文件名一致。