how to make confusion matrix has class names

8 次查看(过去 30 天)
hi all; is there any way to show class names on the confusionmatrix which is plotted by plotconfusion? I found that the set(h,'XTickLabel') does not work.
Thanks a lot regards

回答(1 个)

Antje
Antje 2013-5-23
Hi!
For me this example works fine:
a=[1 1 0 1 0 0 1 0 1 0 1 1 0 0 1 0 0 0 1 0];
b=[1 0 1 1 0 1 1 0 1 0 1 0 0 0 1 1 0 0 1 0];
figure(1)
plotconfusion(a,b)
xlabel('string')
set(gca,'xticklabel',{'class1' 'class2' ''})
Hope this helps!
  2 个评论
Vikas
Vikas 2014-2-10
Hi,
If a=[1 1 0 1 0 0 1 0 1 0 1 1 0 0 1 0 0 0 1 0]; b=[1 0 1 1 0 1 1 0 1 0 1 0 0 0 1 1 0 0 1 0]; a=[1 1 0 1 0 0 1 0 1 0 1 1 0 0 1 0 0 1 1 0]; b=[1 0 1 1 0 1 1 0 1 1 1 0 0 0 1 1 0 0 1 0]; and using plotconfusion(a,b,'name1',c,d,'name2') then is there way to change the name of class in both the plots?
Vikas
Vikas 2014-2-10
Hi,
If a=[1 1 0 1 0 0 1 0 1 0 1 1 0 0 1 0 0 0 1 0]; b=[1 0 1 1 0 1 1 0 1 0 1 0 0 0 1 1 0 0 1 0]; c=[1 1 0 1 0 0 1 0 1 0 1 1 0 0 1 0 0 1 1 0]; d=[1 0 1 1 0 1 1 0 1 1 1 0 0 0 1 1 0 0 1 0]; and using plotconfusion(a,b,'name1',c,d,'name2') then is there way to change the name of class in both the plots?

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Numeric Types 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by