% memory_speed.m
% check advantages of pre-alocation 
% run this script with profile
N=10000;
a=[];
tic;
for k=1:N
    a=[a,k];
end % for k
toc
tic;
a=zeros(1,N);
for k=1:N
    a(k)=k;
end % for k
toc
return