function cache(m) % CACHE is a program to illustrtate the effects of cache and memory on % execution speed. % % cache(m) % % m detrmines the array size n=m a=zeros(m,n); tic for i=1:m for j=1:n a(i,j)=1; end end toc tic for j=1:n for i=1:m a(i,j)=1; end end toc