%!demo
%! ## Plot various iCDFs from the Beta distribution
%! p = 0.001:0.001:0.999;
%! pd1 = makedist ("Beta", "a", 0.5, "b", 0.5);
%! pd2 = makedist ("Beta", "a", 2, "b", 2);
%! pd3 = makedist ("Beta", "a", 5, "b", 2);
%! x1 = icdf (pd1, p);
%! x2 = icdf (pd2, p);
%! x3 = icdf (pd3, p);
%! plot (p, x1, "-b", p, x2, "-g", p, x3, "-r")
%! grid on
%! legend ({"a = 0.5, b = 0.5", "a = 2, b = 2", "a = 5, b = 2"}, ...
%!         "location", "northwest")
%! title ("Beta iCDF")
%! xlabel ("Probability")
%! ylabel ("Value")
%!
%! ## This demonstrates the inverse CDF (quantiles) for beta distributions,
%! ## useful for finding values corresponding to given probabilities.
