#Create 10000 normally distributed random numbers
x = normrnd(10000);
#Create a histogram of the values
h = histogram(x,-3:3);
#Calculate the expected number of datavalues in each group
e = diff(normprob(-3:3)//1)*1000000;
#Calculate the q value
q = sum((h-e)**2/e);
#Test q value with x2prob
p = 1 - x2prob(q,7);
#p<0.05 indicates that the data is not
#normally distributed random data
echo(p);
|