Discretize data into certain categories

1 view (last 30 days)
Andrew Czeizler
Andrew Czeizler on 13 May 2019
Edited: Andrew Czeizler on 13 May 2019
Hi All,
I am trying to discretize a y vector.
I can use the function -
Y = discretize(X,edges)
quite succesfully, however this descretize to all bins.
But what if i only want 3 classifications, depending on where the points lie in the histogram, ie points that lie in the first block, last block and all the middle blocks?
or points that lie in the first two blocks =1, the last two blocks =2 and all the blocks in the middle =3
Many thanks for your help,
Andrew

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!