10/12/2010 2 Analyzing Algorithms • Choosing between multiple methods of implementing an algorithm depends on these and other factors: – The accuracy and precision of the result – The amount of time the computation takes – The amount of memory space needed for the computation 3 Speed: tic and toc • Tool for timing MATLAB code execution – Place the command tic before the line(s) of code which you wish to time – Place the command toc after the line(s) of code which you wish to time • Output – Elapsed time in seconds 4