直接下载下面的压缩包,然后解压出来,把\bin\win32\mexopts里面对应的文件拷贝到matlab2010a安装路径里面对应的文件夹下面即可!!
I have Visual Studio 2010 installed. However, MATLAB doesn't find the compiler.
>> 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:
If I answer n
to the question, I get the following
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]
What is the easiest way to compile my c++ code to make it available in MATLAB? Install Visual C++ 2008? oO
**************************************************************
It depends on what MATLAB version you are using. R2010b supports VS2010 out of the box. If you have R2010a, there is a patch available:
How can I use Microsoft Visual C++ 2010 to create MEX files with MATLAB 7.10 (R2010a)?
Date Last Modified: Friday, March 30, 2012
Solution ID: | 1-D5W493 | |
Product: | MATLAB | |
Reported in Release: | R2010a | |
Platform: | Windows | |
Operating System: | Windows Any |
Subject:
How can I use Microsoft Visual C++ 2010 to create MEX files with MATLAB 7.10 (R2010a)?
Problem Description:
I would like to use Visual C++ 2010 to create MEX files for use in MATLAB.
Solution:The Microsoft Visual C++ 2010 compiler is not supported on the released version of MATLAB 7.10 (R2010a), but support can be added by installing a patch. To install the patch: |