Whhy it shows 'Undefined function or variable 'confMat'; Please check me code. I cant plot the confusion matrix

2 次查看(过去 30 天)
L = 3 ;
figure ('visible','on');
imagesc(confMat);colormap(flipud(gray)) ; caxis ([0,1])
textstr=num2str(confMat(:),'%0.2f');
textstr=strtrim(cellstr(textstr));
[x,y]=meshgrid(1:L);
hstrg=test(x(:),y(:) , textstr(:),
'HorizontalAlignment','center',
'FontSize',10,'FontName','Times New Roman');
midvalue=mean(get(gca,'Clim'));
textColors=repmat(confMat(:).midvalue,1,3);
set(gca,'XTick',1:L,
'XTickLabel',
{'Unripe','Ripe','Fruit'};

回答(1 个)

Walter Roberson
Walter Roberson 2018-6-4
... because you have not created any confMat ?

类别

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

Community Treasure Hunt

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

Start Hunting!

Translated by