rng default; % For reproducibility r = normrnd(10,1,100,1); figure histfit(r) rng default; % For reproducibility r = betarnd(3,10,100,1); figure histfit(r,10,'beta')