%!demo
%! ## Plot the PDF of a Beta distribution, with parameters a = 2 and b = 4,
%! ## truncated at [0.1, 0.8] intervals.  Generate 10000 random samples from
%! ## this truncated distribution and superimpose a histogram with 100 bins
%! ## scaled accordingly
%!
%! pd = makedist ("Beta", "a", 2, "b", 4)
%! t = truncate (pd, 0.1, 0.8)
%! randg ("seed", 21);
%! data = random (t, 10000, 1);
%! plot (t)
%! title ("Beta distribution (a = 2, b = 4) truncated at [0.1, 0.8]")
%! hold on
%! hist (data, 100, 140)
%! hold off
