% Driscoll p. 60 Euler example of memory preallocation
tic
A = rand(200);
%y = ones(200,1);  % requires new y memory allocation for each b if foo loop 
y = ones(200,1001);  % preallocates memory required 
dt = 0.001;
for n = 1:(1/dt)
   y(:,n+1) = y(:,n) + dt*A*y(:,n);
end
toc