怎么将M文件转成EXE文件 阿
我编写了一个 M文件,如何把它编译成EXE文件阿,请高手指点 !1 原帖由 hanwus 于 2006-11-10 15:58 发表我编写了一个 M文件,如何把它编译成EXE文件阿,请高手指点 !1
忘记毛主席的教诲了吗?——自己动手,丰衣足食
搜索一下论坛就ok了 找了半天没找到
那个高手说详细点啊!
那个贴字好像不太清楚,刊不太懂,那位能不能给个例子说清楚怎么生成exe啊? 原帖由 action 于 2006-11-10 20:39 发表那个贴字好像不太清楚,刊不太懂,那位能不能给个例子说清楚怎么生成exe啊?
如果论坛上的帖子还是看不明白的话,自己去看书好了 好象是用mcc这个命令
mcc -W main:exe -T***.m
好象是这样的楼主可以在matlab的帮助文档上查查,确认一下。 mcc -W main-Tlink:exe ***.m 强烈建议你买<<精通matlab6.5>>
后面专门讲了关于生成.exe文件的方法 我也要把它独立出来,谢谢F117_ren_0介绍的书,我好好看一下。 我说的那个方法是可行的,我已经试过了,直接在命令行运行mcc -W main -T link:exe ***.m就可以生成EXE文件和其他的文件了,但是只要保留.exe文件和.ctf文件就行。
另外楼主可以把邮箱给我,我给你传份pdf格式的 《精通matlab6.5 (北航 张志涌)》 有很多种方法可以实现,MATLAB内在的编译器,MATCOM等等,具体可以到http://www.cnitblog.com/edaiqingwa/看看。
为什么我用 snowlion1111的办法出错呢?
为什么我用 snowlion1111的办法出错呢?>> mcc -W main -T link:exe exe.m
Warning: File: c:\matlab6p5p1\exe\exe.m Line: 4 Column: 1
References to "plot" require the C/C++ Graphics Library when executing in stand-alone mode. You must specify -B sgl or -B sglcpp in order to use the C/C++ Graphics Library. Also, if using the -W option, you must specify either the mainhg or libhg wrapper type. A run-time error will occur if the C/C++ Graphics Library is not present when "plot" is called.
lcc preprocessor error: exe_main.c:15 Could not find include file "exe.h"
Error exe_main.c: 19undeclared identifier `mlxExe'
Error exe_main.c: 19invalid initialization type; found `int' expected `pointer to void function(int,pointer to pointer to incomplete struct mxArray_tag defined at C:\MATLAB6p5p1\extern\include\matrix.h 160,int,pointer to pointer to incomplete struct mxArray_tag defined at C:\MATLAB6p5p1\extern\include\matrix.h 160)'
Error exe_main.c: 19initializer must be constant
Error exe_main.c: 19undeclared identifier `_local_function_table_exe'
Warning exe_main.c: 19assignment of pointer to struct _mexLocalFunctionTable to pointer to int
Error exe_main.c: 22undeclared identifier `InitializeModule_exe'
Error exe_main.c: 22invalid initialization type; found `int' expected `pointer to void function(void)'
Error exe_main.c: 22initializer must be constant
Error exe_main.c: 22undeclared identifier `TerminateModule_exe'
Error exe_main.c: 22invalid initialization type; found `int' expected `pointer to void function(void)'
Error exe_main.c: 22initializer must be constant
Error exe_main.c: 34type error in argument 3 to `mclMain'; found `int' expected `pointer to void function(int,pointer to pointer to incomplete struct mxArray_tag defined at C:\MATLAB6p5p1\extern\include\matrix.h 160,int,pointer to pointer to incomplete struct mxArray_tag defined at C:\MATLAB6p5p1\extern\include\matrix.h 160)'
12 errors, 1 warnings
MBUILD.BAT: Error: Compile of 'exe_main.c' failed.
??? Error using ==> mbuild
Unable to complete successfully
??? Error: An error occurred while shelling out to mbuild (error code = 1).
Unable to build executable (specify the -v option for more information).
Error in ==> C:\MATLAB6p5p1\toolbox\compiler\mcc.dll
这是我的程序
function a()x=0:0.01*pi:4*pi;
y=sin(x);
plot(x,y)
页:
[1]