function cls_PlotConfusionMatrix(M) %normalize each row by its column sum_cols = repmat(sum(M, 1), size(M, 1), 1); Mc = M ./ sum_cols; subplot(2, 1, 1), bar(Mc'); sum_rows = repmat(sum(M, 2), 1, size(M, 2)); Mr = M ./ sum_rows; subplot(2, 1, 2), bar(Mr);