You are correct that ROC curves are commonly used for evaluating the performance of binary classification models. For multi-class classification, ROC analysis can be extended using methods like One-vs-Rest (OvR) or One-vs-One (OvO).
You can refer to the attached “roc.m” file for a complete working example.
The below figure is the output of “roc.m”:

The zest of this example lies in using a loop which iterates over each class in a multi-class classification problem to compute and plot ROC curves using the “One-vs-Rest” approach. For each class, it creates a binary label vector where the current class is treated as the "positive" class. It then uses the “perfcurve” function to calculate the False Positive Rate and True Positive Rate for the class, based on the predicted scores.
You can read more about “perfcurve” by using the MATLAB command
>> doc perfcurve
Moreover, if you are using MATLAB R2022a or any later release, then you can use “rocmetrices” to plot ROC curve for multi-class classification.
You can refer to the following documentation for more details about “rocmetrices”:
For an example, you can use the MATLAB command :
openExample('stats/PlotROCCurveForMulticlassClassificationExample')
I hope this helps!
