MATLAB: Creating a normal distribution and chi^2 test

analysisdistributionshistogramplotting

I have a single set of data with 369 values. I want to be able to analyze this, but since there was only one set, I don't believe I can performa any statistical test on the set that would benefit me. So I want to creat a normal distribution using the already known standard deviation and mean. Then I want to perform a chi-squared test on this sample against the data I already have.
I know of the hist command, but dont really think I can use that with just the mean and standard deviation. I found this somewhere but not really sure if this is correct or anything. Any help?
mu = 0.118733568;
sd = 0.141034278;
ix = -3*sd:1e-3:3*sd; %covers more than 99% of the curve
iy = pdf('normal', ix, mu, sd);
plot(ix,iy);

Best Answer

Why do you think you cannot perform any statistical test that will benefit you when you have 369 measurements?
In many contexts, a single data set consisting of 369 measurements is a lot of data.
What hypothesis about your data are you interested in testing.
You mention the chi-square goodness of fit test, if you have the Statistics Toolbox, you can test the assumption that you are data follow a normal distribution with the sample mean and standard deviation
For example:
x = 10+0.5*randn(369,1);
[h,p] = chi2gof(x,'cdf',{@normcdf,mean(x),std(x)});
The above is assuming that x is your data (369 values). You'll see above that h is equal to 0 which means you cannot reject the null hypothesis that the data follow a normal distribution with mean(x) and std(x)
Now consider:
x = 10+0.5*rand(369,1);
[h,p] = chi2gof(x,'cdf',{@normcdf,mean(x),std(x)});