% show what a Poisson distribution of counts looks like for average counts of 1, 10,
% 100 and 1000.
format compact
for k=0:3;
average_counts = 10^k;
% simulate 1000 measurements so that we can create a histogram and
% calculate statistics
counts = poissrnd(average_counts,1,1000);
% create a histogram of this with a bin size of 1 count
x = 0:2*average_counts;
y=hist(counts,x);
scatter(x,y);
% calculate the mean and standard deviation
mu = mean(counts)
sigma = std(counts)
pause;
end;