I am not confident I have not made a mistake, and would really appreciate some input. The following is the code for the chi2gof test,
n = sum(x);
bins = 0:1194;
pd = fitdist(bins','Poisson','Frequency',x');
expCounts = n * pdf(pd,bins);
[h,p,st] = chi2gof(bins,'Ctrs',bins,...
Here is a sample of x (1:100),
x = [3,1,3,4,0,0,0,4,10,2,0,4,6,2,2,2,5,2,0,4,4,2,1,2,3,3,6,0,3,2,0,0,2,4,4,3,0,0,2,3,0,0,0,0,0,0,0,0,1,1,3,2,2,2,1,8,2,4,6,0,3,1,3,1,3,1,1,4,1,2,9,6,6,0,11,3,0,1,2,2,3,0,6,0,3,0,8,5,8,6,7,5,5,0,8,1,3,0,0,8]