默认情况下Matlab 7.10(R2010a)不能识别VS2010,使用“mex -setup”时结果如下:
>> mex -setup Please choose your compiler for building external interface (MEX) files: Would you like mex to locate installed compilers [y]/n? y Select a compiler: [1] Microsoft Visual C++ 6.0 SP1 in d:\Program Files (x86)\Microsoft Visual Studio 8 [0] None 下载VS2010MEXSupport.zip,解压后把所有文件拷贝到Matlab安装目录, 例如:D:\MATLAB2010a\bin\win32\mexopts>> mex-setup Select a compiler: [1] Lcc-win32 C 2.4.1 in D:\MATLAB~1\sys\lcc [2] Microsoft Visual C++ 2010 in d:\vs2010 [3] Microsoft Visual C++ 6.0 in D:\VC6.0\MSDev98 [0] NoneOK