clear all;
close all;

samples = 1e8;
X = rand (samples,1);

N = moro (X);

minval = -6;
maxval = 6;
h = 0.05;
range = minval:h:maxval;
abszissa = zeros (1,length(range)-1);
hits = zeros (1,length(range)-1);

for i=2:length (range)
    hits(i-1) = length (find(N > range(i-1) & N < range(i)));
    abszissa(i-1) = minval + h*(i-1.5);
end

figure (1)
plot (abszissa,hits/samples/h,'b-')
hold on;
plot (range,0,'rx')
plot (abszissa,1/sqrt(2*pi)*exp(-abszissa.^2/2),'k-')
