Try the following:
a = randi([0 255], [4 4]);
figure, imagesc(a), caxis([0 255])
b = zeros( size(a)+1 );
b(1:end-1,1:end-1) = a;
figure, pcolor(b), caxis([0 255]), axis ij
Please note that I expanded the matrix abecause it pcolordeletes the last row / column.


source
share