%Numerische Berechnung der Verteilungsfunktion der Normalverteilung ueber
%die Trapezregel
function y = int_trapez(x,N)

%integration parameters
int_lowerbound = -8;
int_upperbound = x;
int_n = N;

h = (int_upperbound-int_lowerbound)/(int_n);
x = int_lowerbound:h:int_upperbound;

%Trapez-Regel
S = 0;
S = (f(x(1))+f(x(length(x))))/2;
for i=2:length(x)-1
   S = S+f(x(i));
end
S = S*h;

y = S;