The attached file named “confusion_chart.m” demonstrates creating a confusion matrix using “confusionchart”.
Output of the attachment “confusion_chart.m”:
Since “confusionchart” is available from MATLAB R2018b, for older versions, “confusionmat” can be used instead.
The attached file named “confusion_mat.m” demonstrates creating a confusion matrix using “confusionmat”.
Output of the attachment “confusion_mat.m”:
You can use the command “>> doc confusionmat” to know more about it.
I hope this helps you!