標(biāo)題: Matlab與C語言的接口 [打印本頁] 作者: bibi 時間: 2015-4-18 21:33 標(biāo)題: Matlab與C語言的接口 %Matlab R2009a
Matlab可以將C程序編譯為MEX文件供Matlab調(diào)用,第一步是在Matlab的Command Window下輸入命令mex- setup,并根據(jù)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:
[1] Lcc-win32 C 2.4.1 in D:\PROGRA~1\MATLAB\R2009a\sys\lcc
[2] Microsoft Visual C++ 6.0 in C:\Program Files\Microsoft Visual Studio
[0] None
Compiler: 2
Please verify your choices:
Compiler: Microsoft Visual C++ 6.0
Location: C:\Program Files\Microsoft Visual Studio
Are these correct [y]/n? y
Trying to update options file: C:\Documents and Settings\yjsjf\Application Data\MathWorks\MATLAB\R2009a\mexopts.bat
From template: D:\PROGRA~1\MATLAB\R2009a\bin\win32\mexopts\msvc60opts.bat
Done . . .
**************************************************************************
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 ... l?solution=1-5C27B9
Building with the -largeArrayDims option enables the new API.
**************************************************************************