MATLAB: Put data into bins with the equal number of elements

MATLAB

I have
that puts data into equal spaced bins.
But I now want to put data into, let me say, 50 bins with the equal number of observations for each bin.

Best Answer

I'd suggest looking into this file exchange submission.