hanwus 发表于 2006-11-10 15:58

怎么将M文件转成EXE文件 阿

我编写了一个 M文件,如何把它编译成EXE文件阿,请高手指点 !1

eight 发表于 2006-11-10 16:05

原帖由 hanwus 于 2006-11-10 15:58 发表
我编写了一个 M文件,如何把它编译成EXE文件阿,请高手指点 !1

忘记毛主席的教诲了吗?——自己动手,丰衣足食

搜索一下论坛就ok了

hanwus 发表于 2006-11-10 16:12

找了半天没找到

action 发表于 2006-11-10 20:39

那个高手说详细点啊!

那个贴字好像不太清楚,刊不太懂,那位能不能给个例子说清楚怎么生成exe啊?

happy 发表于 2006-11-11 14:09

原帖由 action 于 2006-11-10 20:39 发表
那个贴字好像不太清楚,刊不太懂,那位能不能给个例子说清楚怎么生成exe啊?

如果论坛上的帖子还是看不明白的话,自己去看书好了

snowlion1111 发表于 2006-11-12 15:28

好象是用mcc这个命令
mcc -W main:exe -T***.m
好象是这样的楼主可以在matlab的帮助文档上查查,确认一下。

snowlion1111 发表于 2006-11-15 21:16

mcc -W main-Tlink:exe ***.m

F117_ren_0 发表于 2006-11-16 13:27

强烈建议你买<<精通matlab6.5>>
后面专门讲了关于生成.exe文件的方法

leoplough 发表于 2006-11-16 16:32

我也要把它独立出来,谢谢F117_ren_0介绍的书,我好好看一下。

snowlion1111 发表于 2006-11-17 22:00

我说的那个方法是可行的,我已经试过了,直接在命令行运行mcc -W main -T link:exe ***.m就可以生成EXE文件和其他的文件了,但是只要保留.exe文件和.ctf文件就行。

另外楼主可以把邮箱给我,我给你传份pdf格式的 《精通matlab6.5 (北航 张志涌)》

shiftqiang 发表于 2006-11-30 15:19

有很多种方法可以实现,MATLAB内在的编译器,MATCOM等等,具体可以到http://www.cnitblog.com/edaiqingwa/看看。

action 发表于 2006-11-30 17:48

为什么我用 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

action 发表于 2006-11-30 17:53

这是我的程序

function a()
x=0:0.01*pi:4*pi;
y=sin(x);
plot(x,y)
页: [1]
查看完整版本: 怎么将M文件转成EXE文件 阿