function [x, p] = pdf(Y,N)

[P, x] = hist(Y,N);

p = P/sum(P);