MATLAB: How to get a pcolor plot with equal no. of grids as that of a Z variable

pcolor plot with equal no. of grids as that of a z variable

Z=[1,3,4,5,6; 8,9,6,4,1; 9,5,3,6,5; 3,4,5,6,8]; (4 by 5 matrix)
figure;pcolor(1:5,1:4,x);colormap jet
with the above command i can get 3 by 4 grid point
How I can get the pcolor figure (or with any other command) with the grid points as same as Z variable (here 4 by 5 matrix)

Best Answer

It is not possible with pcolor() without trouble. pcolor() uses surf() and surf creates faces from interpolating from the vertices, and so ends up with one fewer row and column of faces than in the original.
image(Z);
colormap(jet(9))