I would like to use MATLAB to visualize the Central Limit Theorem in action. I would like to use rand() to produce 10 samples of uniform distribution U[0,1] and compute their average, then save it to a matrix ‘Mat’.
I would then use a histogram to visualize the convergence in distribution. How would you do this and normalize that histogram so it is a valid probability density (instead of just counting the frequency of occurrence)?
To generate the samples I am doing something like:
Mat = rand(N,sizeOfVector) > rand(1);
But I guess I am going to the wrong side.
To generate
Nsamples of lengthsizeOfVectoryou start out withrandas you suggested, and then continue as follows (calling the arrayaverageinstead ofMatfor readability):