Matlab的可执行太慢 [英] Matlab executable too slow

查看:835
本文介绍了Matlab的可执行太慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Matlab使用部署工具将我的 Matlab的程序到基于控制台应用程序。 Matlab的 .M 文件大约需要2秒执行,但之后,我将它转换成一个可执行文件,名为 .exe文件,它需要45秒来执行这是太长了。

I converted my Matlab program into a Console based application using the deploytool in Matlab. The Matlab .m file takes around 2 seconds to execute, but after I converted it into an executable and called the .exe, it takes 45 secs to execute which is too long.

我想结合使用PHP的MATLAB程序。是否有任何其他高效,快捷的方式做到这一点?在我的项目,时间确实是一个很大的因素(未显影时间,但应用程序的执行时间)。那么,有没有需要较少的时间任何方法?

I want to integrate the Matlab program with PHP. Is there any other efficient and fast way to do this? In my project, time is really a big factor (not the developing time but the execution time of the application). So are there any methods that take less time?

我在网上看到了这一点,我们可以编写PHP扩展调用Matlab的上。这是方法快还是一样调用 .exe文件文件?是Matlab的codeR此过程中的任何帮助吗?如果有任何替代方案,请别提了。

I saw on the Internet that, we can write PHP extensions to call the Matlab. Is this method fast or the same as calling the .exe file? Is Matlab coder any help for this process? If there is any alternative options please mention it.

推荐答案

一个MATLAB编译的.exe将头顶在第一时间挨你运行它,原因是其在开始MCR:的为什么我用MATLAB编译器4.1编译的应用程序需要很长的时间来启动?

A MATLAB compiled .exe will suffer from overhead at the first time you run it becuase it is starting the MCR: Why does my application compiled with the MATLAB Compiler 4.1 take a long time to start up?

除非你注销或重新启动操作系统时,MCR仍将pre装。另一个有用的读取:加快编译应用程序启动

Unless you log off or restart your OS, the MCR will remain pre-loaded. Another useful read: Speeding up compiled apps startup.

为什么我的单机使用MATLAB编译器需要更长的时间来启动第一次创造出来的?还报道说,连续运行应该更快,但如果以后重新运行,你将不得不重新加载在内存中的进程。

"Why does my stand-alone created using the MATLAB Compiler take longer to start the first time?" also reports that consecutive runs should be faster, but if you rerun later, you will have to reload the process in memory.

您可以在附上code抽动TOC ,部署并检查执行多少时间服用,对启动开销。

You can enclose your code within tic toc, deploy it and check how much time the execution is taking, against startup overhead.

要加快替代的 .exe文件将调用MATLAB用PHP。如果保留MATLAB会话打开你碰到的开销一次。你可以在启动时启动MATLAB,从而避免了与PHP在通话过程中遭受专门的开销。

The alternative to speeding up the .exe would be to call MATLAB with PHP. If you keep the MATLAB session open you run into the overhead once. You could launch MATLAB at startup, thus avoiding to suffer the overhead specifically during the call with PHP.

有关详细信息请参阅从PHP 调用MATLAB,并保持在介意你不希望使用退出除非特别需要的。

For more info read Calling MATLAB from PHP, and keep in mind that you don't want to use exit unless specifically needed.

这篇关于Matlab的可执行太慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆