matab程序转换为.exe可执行文件方法

来源:互联网 发布:淘宝王者荣耀充值便宜 编辑:程序博客网 时间:2024/05/22 00:36

1.写好m文件后,按照下面的步骤执行,生成exe可执行程序,生成完成后,点击exe文件即可执行程序。

>> 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\R2010b\sys\lcc
[2] Microsoft Visual C++ 2008 SP1 in D:\Program Files\Microsoft Visual Studio 9.0
 
[0] None
 
Compiler: 2
 
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: MEX-files generated using Microsoft Visual C++ 2008 require
           that Microsoft Visual Studio 2008 run-time libraries be 
           available on the computer they are run on.
           If you plan to redistribute your MEX-files to other MATLAB
           users, be sure that they have the run-time libraries.
***************************************************************************
 
Trying to update options file: C:\Users\liuyong_wh\AppData\Roaming\MathWorks\MATLAB\R2010b\mexopts.bat
From template:              D:\PROGRA~1\MATLAB\R2010b\bin\win32\mexopts\msvc90opts.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/solutions/en/data/1-5C27B9/?solution=1-5C27B9
           Building with the -largeArrayDims option enables the new API.
**************************************************************************
 
>> mbuild -setup
Please choose your compiler for building standalone MATLAB applications:
 
Would you like mbuild to locate installed compilers [y]/n? y
 
Select a compiler:
[1] Lcc-win32 C 2.4.1 in D:\PROGRA~1\MATLAB\R2010b\sys\lcc
[2] Microsoft Visual C++ 2008 SP1 in D:\Program Files\Microsoft Visual Studio 9.0
 
[0] None
 
Compiler: 2
 
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:\Users\liuyong_wh\AppData\Roaming\MathWorks\MATLAB\R2010b\compopts.bat
From template:              D:\PROGRA~1\MATLAB\R2010b\bin\win32\mbuildopts\msvc90compp.bat
 
Done . . .
 
>> mcc  -m Monte_Carlo_Realibity.m

0 0