Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
centrallimittheorem.octave
%Uniform distribution
x1 = randi(10,1000,1);
[n1 xout1] = hist(x1);
%Sum of uniform distribution
x2 = sum(randi(10,1000,12),2);
m = mean(x2);
s = std(x2);
[n2 xout2] = hist(x2);
%Plot figures
figure
bar(xout1,n1/1000)
export_fig('H:/matlab/histuniform.png')
figure
hold on
bar(xout2,n2/1000)
xs = 30:100
plot(xs,6*normpdf(xs,m,s),'r','LineWidth',2)
export_fig('H:/matlab/histnormal.png')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.