使用matlab编译器生成EXE文件
使用matlab編譯器生成EXE文件
?(2012-09-03 16:58:15) 標(biāo)簽:? 雜談 | 分類:?matlab |
首先確定安裝了C/C++編譯器
然后在command window中作如下設(shè)置:
>> mbuild -setup
Please choose your compiler for building standalone MATLAB applications:
Would you like mbuild to locate installed compilers [y]/n? n
Select a compiler:
[1] Lcc-win32 C 2.4.1
[2] Microsoft Visual C++ 6.0
[3] Microsoft Visual C++ .NET 2003
[4] Microsoft Visual C++ 2005 SP1
[5] Microsoft Visual C++ 2008 Express
[6] Microsoft Visual C++ 2008 SP1
[0] None
Compiler: 6
The default location for Microsoft Visual C++ 2008 SP1 compilers is C:\Program Files\Microsoft Visual Studio 9.0,
but that directory does not exist on this machine.
Use C:\Program Files\Microsoft Visual Studio 9.0 anyway [y]/n? n
Please enter the location of your compiler: [C:\Program Files\Microsoft Visual Studio 9.0] D:\Program Files\Microsoft Visual Studio 9.0
Please verify your choices:
Compiler: Microsoft Visual C++ 2008 SP1
Location: D:\Program Files\Microsoft Visual Studio 9.0
Are these correct [y]/n? y
****************************************************************************
Warning: Applications/components generated using Microsoft Visual Studio
2008 require that the Microsoft Visual Studio 2008 run-time
libraries be available on the computer used for deployment.
To redistribute your applications/components, be sure that the
deployment machine has these run-time libraries.
****************************************************************************
Trying to update options file: C:\Documents and Settings\feiyuan\Application Data\MathWorks\MATLAB\R2009a\compopts.bat
From template: D:\PROGRA~1\MATLAB\R2009a\bin\win32\mbuildopts\msvc90compp.bat
Done . . .
設(shè)置完后,即可創(chuàng)建EXE文件了。(以peak.m文件為例)
在command window中輸入:
mcc -m peak.m
這樣在你設(shè)置的目錄中即可生成一個(gè)名為peak的EXE文件。
注意:
- mcc -m peak.m命令中mcc與-之間有空格;
- 只有M函數(shù)文件才能生成EXE文件
- 如果在M文件的第一行有注釋,在執(zhí)行mcc -m后,會(huì)有如下提示:
Warning: MATLAB Toolbox Path Cache is out of date and is not being used.
Type ‘help toolbox_path_cache’ for more info
總結(jié)
以上是生活随笔為你收集整理的使用matlab编译器生成EXE文件的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Adobe illustrator 剪切
- 下一篇: 精选| 2021年6月R新包推荐(第55