%computes the same code twice the difference in times is due to %preallocation N=500; x=[0:1/N:1]; f=@(y) log(abs(y)); tic for i=1:N+1 K(:,i)=f(x-x(i)); end t1=toc tic for i=1:N+1 K(:,i)=f(x-x(i)); end t2=toc