默认情况下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 <strong> 下载<a target=_blank href="http://www.mathworks.com/support/solutions/attachment.html?resid=1-D92I0C&solution=1-D5W493" rel="nofollow" target="_blank">VS2010MEXSupport.zip</a>,解压后把所有文件拷贝到Matlab安装目录, 例如: </strong><pre class="prettyprint" name="code">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] None
OK