gusucode.com > Matlab脸部识别程序源码 > code/code/dispimg.m
function dispimg(img) % displays an intensity image (on any intensity scale) using a gray-scale colormap % with 256 colors. The intensity data are scaled to use the full colormap, i.e., % the darkest pixel is mapped to 1 and the brightest to 256 % first create a temporary image which maps the darkest pixel to % 1 and the brightest pixel to 256, using the utility function scale.m y = scale(img,-Inf,Inf,1,256); % now plot the image..... %figure; image(y); colormap(gray(256)); axis('off');