poster
2019-12-10, 20:41
我有一个Matlab程序,其运行时间比我想要的要长。有没有内置的方式来分析MATLAB,类似于如何time工作在UNIX?
回答:
有三种方法:
井字/目录 (http://www.mathworks.com/access/helpdesk_r13/help/techdoc/ref/tic.html)
timeit (http://www.mathworks.com/matlabcentral/fileexchange/18798) ,tic / toc的更高级版本
Profiler (http://www.mathworks.com/access/helpdesk/help/techdoc/ref/profile.html) (Matlab窗口中的Desktop-> Profiler)
探查器使您可以查看每行花费的时间,因此,这是查找瓶颈的最佳方法。
更多&回答... (https://stackoverflow.com/questions/2659561)
回答:
有三种方法:
井字/目录 (http://www.mathworks.com/access/helpdesk_r13/help/techdoc/ref/tic.html)
timeit (http://www.mathworks.com/matlabcentral/fileexchange/18798) ,tic / toc的更高级版本
Profiler (http://www.mathworks.com/access/helpdesk/help/techdoc/ref/profile.html) (Matlab窗口中的Desktop-> Profiler)
探查器使您可以查看每行花费的时间,因此,这是查找瓶颈的最佳方法。
更多&回答... (https://stackoverflow.com/questions/2659561)