A piece of fairly simple Matlab script to draw the ROC Curve from an array of scores and an array of labels. function [Tps, Fps] = ROC(scores, labels) %% Sort Labels and Scores by Scores sl = [scores; labels]; [d1 d2] = sort(sl(1,:)); sorted_sl = sl(:,d2); s_scores = sorted_sl(1,:); s_labels = round(sorted_sl(2,:)); %% Constants counts