8.2.12 discretize

Function: [Y, E] = discretize (X, n)
Function: [Y, E] = discretize (X, edges)
Function: [Y, E] = discretize (X, dur)
Function: [Y, E] = discretize (…, 'categorical')
Function: [Y, E] = discretize (…, 'IncludedEdge', IncludedEdge)

Group data into discrete bins or categories.

n is the number of bins to group the values into.

edges is an array of edge values defining the bins.

dur is a duration value indicating the length of time of each bin.

If 'categorical' is specified, the resulting values are a categorical array instead of a numeric array of bin indexes.

Returns: Y - the bin index or category of each value from X E - the list of bin edge values