figure
H = pcolor(xedges,yedges,Ab);
colormap(cm);
set(H, 'linestyle', 'none');
pos=get(gca,'position');
[rows,cols]=size(Ab);
width=pos(3)/(cols-1);
height =pos(4)/(rows-1);
for i=1:cols-1
for j=rows-1:-1:1;
annotation('textbox',[pos(1)+width*(i-1),pos(2)+height*(j-1),width,height], ...
'string',num2str(Ab(j,i)),'LineStyle','none','HorizontalAlignment','center',...
'FontSize',10,'FontWeight','Bold',...
'VerticalAlignment','middle');
end
end
delete(findall(gcf,'String','NaN'));
set(gca,'Xlim',[0 30]);
set(gca,'XTick',[0:3:30]);
set(gca,'Ylim',[0 5]);
set(gca,'YTick',[0:1:5]);
set(gca,'FontSize',10,'FontWeight','Bold');
Best Answer