function xx = norminvcdf(uu, sigma, mu) %NORMINVCDF Inverse Gaussian CDF without using the stats toolbox % % xx = norminvcdf(uu, sigma, mu) % % (Sorry, sigma and mu are the other way around from normcdf.) % Iain Murray, May 2009, tweaked July 2012 if ~exist('sigma', 'var') sigma = 1; end if ~exist('mu', 'var') mu = 0; end xx = sqrt(2) * sigma .* erfinv(2*uu - 1) + mu;