![]() |
#2
mikerusst2007-09-16 21:07
以下是步骤(转载) 今天花了好几个小时才整理出此详细步骤,特拿出来与大家分享
Please choose your compiler for building standalone MATLAB applications:
[1] Lcc C version 2.4 in D:\MATLAB7\sys\lcc [2] Microsoft Visual C/C++ version 6.0 in D:\Microsoft Visual Studio
Location: D:\Microsoft Visual Studio
From template: D:\MATLAB7\BIN\WIN32\mbuildopts\msvc60compp.bat
--> "D:\MATLAB7\bin\win32\mwregsvr D:\MATLAB7\bin\win32\mwcomutil.dll"
To get started, select MATLAB Help or Demos from the Help menu. Warning: No matching builtin function available for D:\MATLAB7\toolbox\simulink\simulink\set_param.bi >> 上面警告的解决方法:
81行 set_param(0,'PaperType',defaultpaper); 82行 set_param(0,'PaperUnits',defaultunits); 注释掉之后,又重新编译了一次,没有警告信息出来了
然后在没有装MATLAB的机子上安装MCRInstaller到D:\MATLAB Component Runtime (目录中,最好不要有空格,如用 D:\MCR 就可以了) 设置环境变量,右键点击“我的电脑”-》属性-》高级-》环境变量-》新建 变量名:Path 变量值:D:\MCR\v70\runtime\win32
GUI界面一次都运行不出来,也没有错误信息提示
{ 因为MATLAB需要用到处理器的数学运算部分(MATLAB默认用的是INTEL的数学处理单元),故需要设置一下BLAS(Basic Linear Algebra Subroutines,就是"基础线性几何子程序"的意思)环境变量. 首先请确认你的MATLAB的文件夹中有如下文件:atlas_Athlon.dll(AMD系列的请用这个), atlas_P4.dll(P4的用这个),atlas_PIII.dll(P3的用这个),atlas_PII.dll(P2的用这个),这些是对应处理器的数值运算优化文件 } 先找到 $MATLAB7\bin\win32目录下的atlas_Athlon.dll(AMD系列CPU使用)和atlas_P4.dll(奔4用)文件,放到MCR目录中(随便),然后设置环境变量 变量名:BLAS_VERSION 变量值:D:\MCR\v70\atlas_Athlon.dll
编译过程中,很可能会有如下报错 >> mcc -m interface
??? Unable to locate close;contentwindow as a function on the MATLAB path Warning: An object instance still exists. Use the objectdirectory command to see a count of existing instances. ??? Depfun error: 'Unable to locate close;contentwindow as a function on the MATLAB path' >> 这种情况是因为我将“close;contentwindow”语句写在按钮控件属性的“callback”里面了 {但是如果只是单个语句的话,是可行的(比如:只有contentwindow)} 此时,只要将“close;contentwindow”语句写在M文件中按钮的“callback”里,再编译就不会出错了 |
我做了个gui的界面,能不能做个可执行的EXE文件放在桌面上,免得每次运行都要启动GUI后才能运行,我找了好多书都没这方面的介绍。