%% Find Cumulative Distribution Function of Normal Distribution
% The cumulative distribution function (CDF) of the normal, or Gaussian, distribution with standard deviation \sigma and mean \mu is
% \phi(x) = \frac{1}{2} \biggl(1+\rm erf\Bigl(
% \frac{x-\mu}{\sigma\sqrt{2}}\Bigr)\biggr).
% Note that for increased computational accuracy, you can rewrite the formula in terms of erfc . For details, see  Tips.
% Plot the CDF of the normal distribution with \mu=0 and \sigma=1.

x = -3:0.1:3;
y = (1/2)*(1+erf(x/sqrt(2)));
plot(x,y)
grid on
title('CDF of normal distribution with \mu = 0 and \sigma = 1')
xlabel('x')
ylabel('CDF')

% Copyright 2015 The MathWorks, Inc.