matlab vs2010编译器xml,如何在MATLAB R2010a 中使用Visual C++ 2010编译器
1、安装补丁VS2010MEXSupport.zip
参考http://www.mathworks.cn/support/solutions/en/data/1-D5W493/index.html?solution=1-D5W493
由于MATLAB R2010a 发布的时间要比
VS2010早,所以在该版本识别不了VC++2010编译器。不过R2010a之后的版本应该不会有这种问题了。
解压补丁包,将其中的文件放到 D:\Program
Files\MATLAB\R2010a\bin\win32\mexopts 文件夹下。
2、在MATLAB中安装VC++ 2010 编译器
打开Matlab,在 command window
中输入 mex -setup
————————————————————————————————————————————-
>> mex -setup
Please 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 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] 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] None
Compiler:12
————————————————————————————————————————————————
注意,如果选择 n 之后,没有列出这么多编译器选项,甚至没有出现VC++ 2010。
不要慌,此时选择 0,即None。
—————————————————————————————————————————————————
Compiler: 0
mex: No compiler selected. No action taken.
**************************************************************************
Warning: The MATLAB C and Fortran API has changed to support
MATLAB
variables with more than 2^32-1 elements. In the near future
you will be required to update your code to utilize the new
API. You can find more information about this at:
http://www.mathworks.com/support/solutions/en/data/1-5C27B9/?solution=1-5C27B9
Building with the -largeArrayDims option enables the new API.
**************************************************************************
—————————————————————————————————————————————————
然后在command window 里再次输入 mex -setup
—————————————————————————————————————————————————
>> mex -setup
Please choose your compiler for building external interface (MEX)
files:
Would you like mex to locate installed compilers [y]/n?
n (一定要选择
n)
—————————————————————————————————————————————————
此时就会列出很多编译器,包括已经VC++2010。如果还没有,可重复几次以上过程。当然前提是必须安装VS2010,否则,再怎么重复,也找不到VC++2010编译器。
列出VC++2010编译器之后,我相信接下该怎么做对大家来说没啥问题。
3、error C2371: 'char16_t' : redefinition; different
basic types
在混合编程中,也许会出现如下错误:
—————————————————————————————————————————————————
C:\Microsoft Visual Studio 10.0\VC\INCLUDE\yvals.h(576) : error
C2371: 'char16_t' : redefinition; different basic types
C:\Matlab\r2010a\extern\include\matrix.h(330) : see declaration of
'char16_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。
matlab vs2010编译器xml,如何在MATLAB R2010a 中使用Visual C++ 2010编译器相关推荐
- (csc)Visual C# 2010 编译器选项.
Visual C# 2010 编译器选项 - 输出文件 - /out:<文件> 指定输出文件名(默认值: ...
- matlab yalmip安装教程,如何在matlab路径中安装yalmip Matlab R2014a添加yalmip图文教程
yalmip是什么?可以说,yalmip是一位"集大成者",它不仅自己包含基本的线性规划求解算法,比如linprog(线性规划).bintprog(二值线性规划).bnb(分支界定 ...
- matlab 创建 符号矩阵,如何在MATLAB中动态创建符号矩阵?
我需要在MATLAB中创建一个符号矩阵.它可以静态地完成为如何在MATLAB中动态创建符号矩阵? syms a11 a12 a21 a22; A = [a11 a12; a21 a22]; 或使用紧凑 ...
- Visual C++2010编译器常用选项设置-新增支持并行计算
分享一下我老师大神的人工智能教程!零基础,通俗易懂!http://blog.csdn.net/jiangjunshow 也欢迎大家转载本篇文章.分享知识,造福人民,实现我们中华民族伟大复兴! Visu ...
- matlab 思维数组_如何在Matlab中保存多维数组?
I have an array M=(1000000,12,2,2). How do I write it to a file to work on later? save('filename.txt ...
- matlab使用mex,c – 如何在Matlab中配置MEX功能
分析MEX文件是棘手的,因为MEX文件是共享库.在 Linux上使用标准'gprof'方法无法做到这一点 – gprof根本不这样做.我尝试使用sprof,但是我得到了 "PLTREL no ...
- matlab设置图片名称,如何在matlab中批量修改图片名称
%% % 提供原图片文件路径 oldPath = 'H:\毕业设计相关matlab代码\图片'; % 原来的放图片的文件夹地址 newPath = 'C:\Users\HS\Desktop\实验图片' ...
- matlab计算空间卷积,如何在MATLAB和WolframAlpha中计算函数与自身的卷积?
我对Mathematica了解不多,所以我只能帮助你(部分)了解Matlab部分. 使用Matlab进行卷积转换函数意味着您可以用数字方式进行卷积.你对积分定义的意思是你想象征性地做它.为此,您需要M ...
- MATLAB如何调用simulink,如何在matlab界面调用simulink
背景描述:本人想在matlab2014a上用遗传算法对模型进行多参数优化.模型的输出是油耗值,每次仿真结束后,模型最终的油耗值会用于计算适应度函数.尝问题及做法描述:遗传算法的整体框架都搭建好了,现在 ...
最新文章
- PHP 通过随机数获得ASCII 值返回字符。
- 为了在元宇宙里摸到东西,扎克伯格整出了一款新电子皮肤,成本6美元
- 单片机成长之路(51基础篇) - 008 C51 的标示符和关键字
- Loadrunner多服务器连接问题
- Xenix — 微软与UNIX的短暂爱恋
- Maven详解及相关操作
- 是几进制_10分钟带你了解什么是二进制
- 链接数据库 并且进行查询操作
- 6.3使用用户名或邮箱都能登录
- 普华永道:2030年区块链价值将突破30万亿
- Java冒泡排序法 降序
- matlab统计字符个数,Matlab函数统计字符串中莫个字母含量
- 自动驾驶与汽车现状前沿
- 知识星球<我们谈论数据科学>-python30天打卡训练营Day1
- PHP的exec()函数用法详解
- Matplotlib绘图笔记
- 【流体机械原理及设计06】
- html网页宽度自动适应手机屏幕
- splatter包安装
- unity android 震动,unity 调用android的震动