clear all K = [2 4 6] for k=K k x = rand(1,10^k); y = rand(1,10^k); tic scal1 = dotprod(x,y); t1 = toc tic scal2 = x*y'; t2 = toc ratio = t1/t2 end