I am willing to overlay a equalized cdf with equalized histogram in matlab. But it's really hard to find any recommends. so if you can, would you please let me know about that?
You can use 'hold on' with a histogram:
[n,x]=hist(rand(1,100),20); % find the histogram bar(x,n./sum(n)) % plot normalized histogram hold on % don't delete current plot plot([0 1],[0.1 0.1]) % plot a uniform pdf axis([0 1 0 0.12]) % make room around the plot
Another example using a normal distribution, which shows how to normalize the histogram so that its area is one:
r=randn(1,1000); % normal random variable [n,x]=hist(r,25); delta=x(2)-x(1); n=n./(delta*sum(n)); % n is normalized so that its area is 1 bar(x,n) hold on d=-4:0.1:4; plot(d,(1/sqrt(2*pi))*exp(-(d.*d)./2),'r') % plot of the normal pdf