tbl = tabulate(x)
tbl = tabulate(x) creates
a frequency table of data in vector
tbl is arranged as follows:
1st column — The unique values of
2nd column — The number of instances of each value
3rd column — The percentage of each value
x is a numeric array,
a numeric matrix. If the elements of
x are positive
tbl includes 0 counts for integers between
do not appear in
x is a categorical variable, character
array, or cell array of character vectors,
a cell array.
tabulate(x) with no output arguments displays
the table in the command window.
tabulate([1 2 4 4 3 4])
Value Count Percent 1 1 16.67% 2 1 16.67% 3 1 16.67% 4 3 50.00%
This function fully supports tall arrays. For more information, see Tall Arrays (MATLAB).