Note: Use only in the MuPAD Notebook Interface. This functionality does not run in MATLAB.
categorizes the numerical data into a number of bins given by semiopen
intervals (ai, bi].
This function returns a table with the entries (rows) corresponding
to the bins. Each entry shows the following information:
The number of the bin
The interval defining the bin
The number of data in the bin
The data contained in the bin
x := [-10.1, -1, 1.1, 3.5, 13, 0, -5.5, 0.5, 7.9, 15, 0.15, 6.7, 2, 9]: stats::frequency(x)
Now, categorize the same data into 5 bins:
When creating the bins, you can specify the intervals. For example, divide the data into two bins: one bin contains the numbers that are less or equal to zero, and the other bin contains the numbers that are greater than zero:
stats::frequency(x, [[-infinity, 0], [0, infinity]])
For graphical interpretation of the data binning, see Create Bar Charts, Histograms, and Pie Charts.