[p,x] = hist(sample1); plot(x,p/sum(p)); %PDF
[f,x] = ecdf(sample1); plot(x,f); %CDF
Ckeckout help hist to see how to control the points at which you want to compute the probability densities.
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!