function npdf=dfresize(pdf, samples) % dfresize(pdf, samples) Generates a new version of the given pdf with the % given number of samples. Useful for speeding up some operations. if ispf(pdf)==0 | isdiscrt(pdf)==1 error('not a valid pdf') end x=xvals(pdf); p=sample(pdf, min(x), max(x), (max(x)-min(x))/samples); x=[min(x):(max(x)-min(x))/samples:max(x)]; if ~(length(p)==length(x)) x=x(1:(length(x)-1)); end npdf=[pdf(1,:); x' p']; if ispf(npdf)==0 p=p./ttlprob(npdf); npdf=[pdf(1,:); x' p']; end