Create categorical data out of numerical or continuous data by cutting into intervals.
If breaks is a scalar, the data is cut into that many equal-width intervals. If breaks is a vector of break points, the category has
length (
breaks) - 1
groups.The returned value is a vector of the same size as x telling which group each point in x belongs to. Groups are labelled from 1 to the number of groups; points outside the range of breaks are labelled by
NaN
.