www.gusucode.com > graphics 案例源码程序 matlab代码 > graphics/LoadAndDisplayImageUsingAssociatedColormapExample.m

    %% Load MAT-File and Display Image
% Load the |mandrill| file which contains an indexed image, |X|, and its
% associated colormap, |map|. Display the image using its colormap. 

% Copyright 2015 The MathWorks, Inc.


load mandrill
image(X)
colormap(map)

%%
% Remove the axis tick marks and tick labels. Set the aspect ratio to
% obtain square pixels.

axis off
axis image