The Matlab function imagesc automatically scales the data matrices to be displayed as a colored figure. The actual color depends on the color map used.
How does the scaling work? Actually, it is just a linear scaling which maps the original data values to the color map indices.
A blog post from Steve explained it detailedly, which can be found http://blogs.mathworks.com/steve/2006/02/10/all-about-pixel-colors-part-3/.