The code is as follows:
g1 = [1 1 2 2 3 3]'; % Known groups
g2 = [1 1 2 3 4 5]'; % Predicted groups
[C,order] = confusionmat(g1,g2);
figure; imagesc(C);
accuracyAll = trace(C)/sum(C(:));
disp(['Total accuracy is ',num2str(accuracyAll*100),'%']);
When you run the code, you will get a figure. My question is how to add the corresponding accuracy in the blocks of the figure?