Given a set of elements, I would love to efficiently partition their numerical values into bins, and then return the count in each bin, as well as the bin edges.

MATLAB used to have super simple functions for this (i.e. hist, and histc). I wrote my own (quick and dirty) code. Which is the best (and simplest) way to do it ?

Note: I don’t care about plotting - I need to do subsequent analysis on the bins and the counts.

Thanks for your patience and help.