FUNCTION REFERENCE
confusionmat
Count observed and predicted group pairs.
Count observed and predicted group pairs.
Syntax
[C,order] = confusionmat(group,grouphat,'Order',order)Rows of C are observed groups, columns predicted groups. Numeric, logical, character rows, cell arrays of character rows, and string groups are accepted. Default numeric order is sorted; text uses first appearance. Order specifies a unique complete list, including optional unobserved groups. Pairs with NaN, missing strings or empty text labels are ignored. Text order is returned as a column cell array.
Example
[c,o] = confusionmat([1 2 1],[1 1 2]); % c = [1 1;1 0]Differences from MATLAB: No categorical groups. Character arrays and literals use one group per row. Text group classes must match numeric versus text kind.
These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.