MuPAD® notebooks are not recommended. Use MATLAB® live scripts instead.
MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.
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.