Just figure out what class numbers the classes you go refer to and add the confusion matrix you got to your master, standard 6-by-6 confusion matrix. For example if you got a 2x2 array and you know that those two classes would have really been class #3 and class #5 if you would have had the full 6 classes present, then just do
masterCM(3,3) = masterCM(3,3) + thisCM(1,1);
masterCM(5,5) = masterCM(5,5) + thisCM(2,2);
masterCM(3,5) = masterCM(3,5) + thisCM(1,2);
masterCM(5,3) = masterCM(5,3) + thisCM(2,1);
