住房建设部官方网站设计费计取,wordpress仿百度搜索主题,石家庄营销型网站建设费用,青色网站欣赏1、安装补丁VS2010MEXSupport.zip参考http://www.mathworks.cn/support/solutions/en/data/1-D5W493/index.html?solution1-D5W493由于MATLAB R2010a 发布的时间要比VS2010早#xff0c;所以在该版本识别不了VC2010编译器。不过R2010a之后的版本应该不会有这种问题了。解压补…1、安装补丁VS2010MEXSupport.zip参考http://www.mathworks.cn/support/solutions/en/data/1-D5W493/index.html?solution1-D5W493由于MATLAB R2010a 发布的时间要比VS2010早所以在该版本识别不了VC2010编译器。不过R2010a之后的版本应该不会有这种问题了。解压补丁包将其中的文件放到 D:\ProgramFiles\MATLAB\R2010a\bin\win32\mexopts 文件夹下。2、在MATLAB中安装VC 2010 编译器打开Matlab在 command window中输入 mex -setup————————————————————————————————————————————- mex -setupPlease choose your compiler for building external interface (MEX)files:Would you like mex to locate installed compilers [y]/n?n (一定要选择 n)Select a compiler:[1] Intel C 11.1 (with Microsoft Visual C 2008 SP1linker)[2] Intel C 9.1 (with Microsoft Visual C 2005 SP1 linker)[3] Intel Visual Fortran 11.1 (with Microsoft Visual C 2008 SP1linker)[4] Intel Visual Fortran 11.1 (with Microsoft Visual C 2008 Shelllinker)[5] Intel Visual Fortran 10.1 (with Microsoft Visual C 2005 SP1linker)[6] Lcc-win32 C 2.4.1[7] Microsoft Visual C 6.0[8] Microsoft Visual C 2005 SP1[9] Microsoft Visual C 2008 Express[10] Microsoft Visual C 2008 SP1[11] Microsoft Visual C 2010[12] Microsoft Visual C 2010 Express[13] Open WATCOM C[0] NoneCompiler:12————————————————————————————————————————————————注意如果选择 n 之后没有列出这么多编译器选项甚至没有出现VC 2010。不要慌此时选择 0即None。—————————————————————————————————————————————————Compiler: 0mex: No compiler selected. No action taken.**************************************************************************Warning: The MATLAB C and Fortran API has changed to supportMATLABvariables with more than 2^32-1 elements. In the near futureyou will be required to update your code to utilize the newAPI. You can find more information about this at:http://www.mathworks.com/support/solutions/en/data/1-5C27B9/?solution1-5C27B9Building with the -largeArrayDims option enables the new API.**************************************************************************—————————————————————————————————————————————————然后在command window 里再次输入 mex -setup————————————————————————————————————————————————— mex -setupPlease choose your compiler for building external interface (MEX)files:Would you like mex to locate installed compilers [y]/n?n (一定要选择n)—————————————————————————————————————————————————此时就会列出很多编译器包括已经VC2010。如果还没有可重复几次以上过程。当然前提是必须安装VS2010否则再怎么重复也找不到VC2010编译器。列出VC2010编译器之后我相信接下该怎么做对大家来说没啥问题。3、error C2371: char16_t : redefinition; differentbasic types在混合编程中也许会出现如下错误—————————————————————————————————————————————————C:\Microsoft Visual Studio 10.0\VC\INCLUDE\yvals.h(576) : errorC2371: char16_t : redefinition; different basic typesC:\Matlab\r2010a\extern\include\matrix.h(330) : see declaration ofchar16_t—————————————————————————————————————————————————原因是VS2010中的yvals.h添加了char16_t的定义而Matlab的matrix.h也包含对char16_t的定义所以同时包含这两个头文件的话会导致重复定义char16_t的错误。解决方案参考http://maciejgryka.com/bits/2011/09/char16_t-conflict-while-mexing-with-vs2010/完全没有必要修改这两个头文件(以防修改之后会在将来导致一些问题)只需要在包含matrix.h之前包含yvals.h即可。例如#include #if (_MSC_VER 1600)#define __STDC_UTF_16__#endif#include mex.h注mex.h 包含matrix.h。这就要求我们必须知道所包含的头文件是否包含matrix.h。