MATLAB: Create checkerboard plot from a matrix where *each point* is represented by a colored square

checkerboard plotmatrix to checkerboard

I would like to represent a set of 2-d data (3 x 4 matrix) visually using a "checkerboard"-type plot. However the options for doing this reduce each dimension by 1, so the checkerboard is 2 x 3.
Instead I would like the relative magnitude of each data point to be represented by the intensity of color on a color scale.
I have tried pcolor and surf, but these do not seem to achieve the desired result.
My guess is there should be a simple way to do this, however I have not been able to figure it out.

Best Answer

Perhaps using colormap() and image() or imshow():
% Create a 3x4 array of sample data in the range of 0-255.
data = randi(255, 3, 4)
% Display it.
image(data);
% Initialize a color map array of 256 colors.
colorMap = jet(256);
% Apply the colormap and show the colorbar
colormap(colorMap);
colorbar;