crosstab
Create a cross-tabulation (contingency table) t from data vectors.
The inputs x1, x2, ... xn must be vectors of equal length with a data type of numeric, logical, char, or string (cell array).
As additional return values crosstab
returns the chi-square statistics
chisq, its p-value p and a cell array labels, containing
the labels of each input argument.
Source Code: crosstab