设置mex以使用Visual Studio 2010编译器

Eta*_*tan 10 configuration matlab mex visual-studio-2010

我安装了Visual Studio 2010.但是,MATLAB找不到编译器.

>> 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: 

[0] None 

Compiler:
Run Code Online (Sandbox Code Playgroud)

如果我回答n这个问题,我会得到以下信息

Would you like mex to locate installed compilers [y]/n? n

Select a compiler: 
[1] Intel C++ 11.1 (with Microsoft Visual C++ 2008 SP1 linker) 
[2] Intel C++ 9.1 (with Microsoft Visual C++ 2005 SP1 linker) 
[3] Intel Visual Fortran 11.1 (with Microsoft Visual C++ 2008 SP1 linker) 
[4] Intel Visual Fortran 11.1 (with Microsoft Visual C++ 2008 Shell linker) 
[5] Intel Visual Fortran 10.1 (with Microsoft Visual C++ 2005 SP1 linker) 
[6] Microsoft Visual C++ 2005 SP1 
[7] Microsoft Visual C++ 2008 Express 
[8] Microsoft Visual C++ 2008 SP1 

[0] None 

Compiler: 8

The default location for Microsoft Visual C++ 2008 SP1 compilers is C:\Program Files (x86)\Microsoft Visual Studio 9.0, 
but that directory does not exist on this machine.  

Use C:\Program Files (x86)\Microsoft Visual Studio 9.0 anyway [y]/n? n
Please enter the location of your compiler: [C:\Program Files (x86)\Microsoft Visual Studio 9.0] 
Run Code Online (Sandbox Code Playgroud)

编译我的c ++代码以使其在MATLAB中可用的最简单方法是什么?安装Visual C++ 2008?OO

Amr*_*mro 7

这取决于您使用的MATLAB版本.R2010b支持开箱即用的VS2010.如果您有R2010a,可以使用补丁: