clear all
disp('Not preallocated:')

tic
for I = 1:10000
 not_pre_allo(I) = rand;
end
toc

disp('Preallocated:')

tic
pre_allo = zeros(10000,1); 
for I = 1:10000
 pre_allo(I) = rand; 
end
toc