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.
精彩评论