开发者

How can I measure how long a function runs in Matlab?

I have a M开发者_如何学JAVAatlab program that is running longer than I'd like it to. Is there built-in way to profile Matlab, similar to how time works in unix?


There are three ways:

  • Tic/toc
  • timeit, a fancier version of tic/toc
  • Profiler (Desktop->Profiler in the Matlab Window)

The profiler allows you to see how much time each line takes, and thus, it is the best way to find bottlenecks.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜