% plot Gaussian pdf: dx=0.01; x = [-4.0:dx:4.0]; p = exp(-0.5*x.^2)/sqrt(2.0*pi); plot(x, p, 'linewidth', 4) hold on % show area of integral: x1=1.0; x2=2.0; area(x((x>=x1)&(x<=x2)), p((x>=x1)&(x<=x2)), 'FaceColor', 'r' ) hold off % compute integral between x1 and x2: P = sum(p((x>=x1)&(x=x1)&(r