% You have a choice of the following color maps: % hsv - Hue-saturation-value color map. % hot - Black-red-yellow-white color map. % gray - Linear gray-scale color map. % bone - Gray-scale with tinge of blue color map. % copper - Linear copper-tone color map. % pink - Pastel shades of pink color map. % white - All white color map. % flag - Alternating red, white, blue, and black color map. % lines - Color map with the line colors. % colorcube - Enhanced color-cube color map. % vga - Windows colormap for 16 colors. % jet - Variant of HSV. % prism - Prism color map. % cool - Shades of cyan and magenta color map. % autumn - Shades of red and yellow color map. % spring - Shades of magenta and yellow color map. % winter - Shades of blue and green color map. % summer - Shades of green and yellow color map. load gallery.mat % the above command reads array b with 30 rows and 24x16 columns % each row corresponds to one image p=['Size of b: ' num2str(size(b))]; % prints out the size of b disp(p) a=reshape(b(1,:),24,16); %this reshapes 1 row into 2D pixel array p=['Size of a: ' num2str(size(a))]; disp(p) colormap(gray); %this assigns colors to the image image(a) %this displays image pause %hit any key to continue a=reshape(b(3,:),24,16); colormap(cool(256)); image(a) pause a=reshape(b(3,:),24,16); colormap(gray(256)); image(a) pause % the following reads and displays a bit map image a=imread('lena128.bmp'); colormap(gray(256)); image(a)