您的位置:首页 > 编程语言 > MATLAB

matlab 连接 c

2014-04-03 19:49 141 查看
写第三篇论文了。。。摔

找了好久的代码,其中一个在.m中诡异的有一个.c,看readme才知道,这是mex

就是将matlab与vc/vs连接,在matlab中使用c代码

连接的方式是:

在交互页面输入: 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 ,连接要求,matlab与VC版本要相对应,这里用的是低级的 VC6.0与matlab7.0

Select a compiler:
[1] Borland C++Builder version 6.0
[2] Borland C++Builder version 5.0
[3] Borland C++Builder version 4.0
[4] Borland C++Builder version 3.0
[5] Borland C/C++ version 5.02
[6] Borland C/C++ version 5.0
[7] Borland C/C++ (free command line tools) version 5.5
[8] Compaq Visual Fortran version 6.1
[9] Compaq Visual Fortran version 6.6
[10] Digital Visual Fortran version 6.0
[11] Digital Visual Fortran version 5.0
[12] Lcc C version 2.4
[13] Microsoft Visual C/C++ version 7.0
[14] Microsoft Visual C/C++ version 7.1
[15] Microsoft Visual C/C++ version 6.0
[16] Microsoft Visual C/C++ version 5.0
[17] WATCOM C/C++ version 11
[18] WATCOM C/C++ version 10.6

[0] None

Compiler: 15

The default location for Microsoft Visual C/C++ compilers is C:\Program Files\Microsoft Visual Studio,
but that directory does not exist on this machine.

Use C:\Program Files\Microsoft Visual Studio anyway [y]/n? n


这里还是选N ,要将路径改至与VC路径相同。

Please enter the location of your compiler: [C:\Program Files\Microsoft Visual Studio] D:\school\VC 6.0\Microsoft Visual Studio

Please verify your choices:

Compiler: Microsoft Visual C/C++ 6.0
Location: D:\school\VC 6.0\Microsoft Visual Studio

Are these correct?([y]/n): y

Try to update options file: C:\Users\sony\Application Data\MathWorks\MATLAB\R14\mexopts.bat
From template:              D:\SCHOOL\MATLAB\BIN\WIN32\mexopts\msvc60opts.bat

Done . . .
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: