Matlab repmat

broken image
broken image

You can click on a function name to bring up its sourcecode. This is really the statistic you should pay attention to. Self-time, denoted by a dark blue band, is the time spent within a function not including how long was spent in functions called from here. The report shows a breakdown of all the functions called from your function, the number of times they were called, and the total time spent executing them.

broken image

It automatically generates a web page summarizing the results, which you can click on to 'drill down'. MATLAB has an excellent profiler, which can tell you how much time your code spends in each one of its functions. Also, remember that correctness is more important than speed! The usual pattern is that 80% of the the time is spent in 20% of the code, so you can focus your efforts accordingly. A slightly more complex example of vectorizationīefore spending a lot of time optimizing your code, you should first identify the key bottlenecks using the profiler.Using built-in functions that are already vectorized.

broken image