Note: This page has been translated by MathWorks. Click here to see

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Compute confusion matrix for classification problem

`C = confusionmat(group,grouphat)`

`C = confusionmat(group,grouphat,'Order',grouporder)`

`[C,order] = confusionmat(___)`

uses `C`

= confusionmat(`group`

,`grouphat`

,`'Order'`

,`grouporder`

)`grouporder`

to order the rows and columns of
`C`

.

Use

`confusionchart`

to calculate and plot a confusion matrix. Additionally,`confusionchart`

displays summary statistics about your data and sorts the classes of the confusion matrix according to the class-wise precision (positive predictive value), class-wise recall (true positive rate), or total number of correctly classified observations.