% go with i through values 1, 2, 3 ... 1000
for i=1:1000;
   % assign to index i of matrix B 
   % a normally distributed value
   B(i) = randn();
   
   % assign to index i of matrix C
   % the average value of the elements in
   % matrix B defined so far.
   C(i) = sum(B) / i;
end

% visualize the behaviour of the average.
plot(1:1000, C);