I appreciate all the comments etc.
But i don't have the time to fix these corrections. Its open source so feel free to change it and reuse it yourself.
Carsten Allefeld has made some modifications that fix the normalisation problem. Except in the case of the type 5 distribution.
The sizeOut error has also been fixed.
edit your file:
122: case 1
136: p = betapdf(X,m1+1,m2+1)/sigma;
177: case 6
187: p = fpdf(X,nu1,nu2)/sigma;
195: p = fpdf(X,nu1,nu2)/sigma;
it is not correct, but plot norm PDF hold on Hist (ecdfhist)