nvec = 1:200; tvec = []; outerclk = tic(); for n = nvec Z = rand(n,2) * [1;i] - (0.5+0.5i); X = real(Z); Y = imag(Z); tic(); figure; scatter(X,Y); drawnow(); close; tvec(end+1) = toc(); end toc(outerclk) sum(tvec) plot(nvec,tvec);