want to see what this flop-count stuff is... >> help flops FLOPS Floating point operation count. FLOPS returns the cumulative number of floating point operations. FLOPS(0) resets the count to zero. It is not feasible to count absolutely all floating point operations, but most of the important ones are counted. Additions and subtractions are one flop if real and two if complex. Multiplications and divisions count one flop each if the result is real and six flops if it is not. Elementary functions count one if real and more if complex. Some examples. If A and B are real N-by-N matrices, then A + B counts N^2 flops, A * B counts 2*N^3 flops, LU(A) counts roughly (2/3)*N^3 flops. A ^ P counts 2*C*N^3 flops where, for integer P and D = DEC2BIN(P), C = length(D)+sum(D=='1')-1. set the flop counter to zero >> flops(0); >> 2 + 3 ans = 5 how many flops have happened: >> flops ans = 1 do some more operations and check again >> for i=1:100; 2+3; end >> flops ans = 101 reset flop counter and check it's reset. Then see how many flops a trig function counts for. >> flops(0); >> flops ans = 0 >> cos(1); >> flops ans = 1 how does cputime work? >> help cputime CPUTIME CPU time in seconds. CPUTIME returns the CPU time in seconds that has been used by the MATLAB process since MATLAB started. For example: t=cputime; your_operation; cputime-t returns the cpu time used to run your_operation. The return value may overflow the internal representation and wrap around. See also ETIME, TIC, TOC, CLOCK first set t to be the current cputime, then do some work, and find the elapsed cputime by taking the difference between the current cputime and the original cputime. >> t = cputime >> t = 0 >> A = inv(rand(100,100)); >> t = cputime-t t = 44.3800 how does tic, toc work? >> help tic TIC Start a stopwatch timer. The sequence of commands TIC, operation, TOC prints the number of seconds required for the operation. See also TOC, CLOCK, ETIME, CPUTIME. >> tic; A = inv(rand(200,200)); toc elapsed_time = 0.8800 >> tic; A = inv(rand(300,300)); toc elapsed_time = 3.4000 compare the flop counts for evaluating a 100th degree polynomial in a direct manner, versus evaluating it in a clever manner. >> n = 100; 2*n/60, (n^2/2 + 3*n/2)/60 ans = 3.3333 ans = 85.8333 compare the flop counts for evaluating a 1000th degree polynomial in a direct manner, versus evaluating it in a clever manner. We then convert the longer time in tominutes and then into hours >> n = 1000; 2*n/60, (n^2/2 + 3*n/2)/60 ans = 33.3333 ans = 8.3583e+003 >> ans/60 ans = 139.3056 >> ans/60 ans = 2.3218 >> diary off