MATLAB: Put data into bins with pre-specified intervals

MATLAB

I have data distributed over [0,1]. I want to put data into pre-specified bins such as 0:.1:1. How can one do this?

Best Answer

Use histcounts and specify the bin edges using the syntax [N,edges] = histcounts(X,edges)