Labfans是一个针对大学生、工程师和科研工作者的技术社区。 论坛首页 | 联系我们(Contact Us)
MATLAB爱好者论坛-LabFans.com
返回   MATLAB爱好者论坛-LabFans.com > 工程数学软件 > MATLAB论坛
MATLAB论坛 一切MATLAB相关问题在此讨论。
 
 
主题工具 显示模式
旧 2008-10-16, 06:13   #1
s2002teven
初级会员
 
注册日期: 2008-10-16
年龄: 38
帖子: 1
声望力: 0
s2002teven 正向着好的方向发展
默认 关于m文件和c-mex的问题

最近在做毕业设计,写了一个包含几个subfunction的m文件,但用profiler发现其中2个子函数运行很慢占用大量资源,于是想把这2个子函数编译成C代码。使用了matcom, mcc, comtool都失败了。偶然使用mcc -x命令时出现下面的话:
-x is no longer supported. The MATLAB Compiler no longer generates
MEX files because there is no longer any performance advantage to doing so: the
MATLAB JIT accelerates M-files by default.
也就是说m文件转换成C代码并用mex运行并不能提高运行速度?
但是在HELP文件里又发现下面的话:
Coding Loops in a MEX-File
If there are instances where you cannot vectorize and must use a for or while loop, consider coding the loop in a MEX-file. In this way, the loop executes much more quickly since the instructions in the loop do not have to be interpreted each time they execute.
也就是说有for语句时MEX确实能加速。
到底转换后会不会加速呢?我的子程序里确实有for语句且多次调用。我是matlab 7.0.1 R14
另实验室电脑装的是linux没有VC++。
如果我想把m文件转移到linux的平台没有matlab应该怎么做?
以上2个问题请教大家了,或有相关的网站或文章推荐,谢谢!:lovely:
s2002teven 当前离线   回复时引用此帖
 


发帖规则
不可以发表新主题
不可以发表回复
不可以上传附件
不可以编辑自己的帖子

启用 BB 代码
论坛启用 表情符号
论坛启用 [IMG] 代码
论坛禁用 HTML 代码



所有时间均为北京时间。现在的时间是 11:55


Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.