% RGBOpic
% usage: RGBOpic(pic)
% show picture and its RGB components
% pic is assumed to be an image file where  X is the picture and map is the colormap


function Y = RGBOpic(pic);

% load picture
load(pic)

% define colormaps

R = zeros(size(map));
R(:,1)= map(:,1);
G = zeros(size(map));
G(:,2)=map(:,2);
B = zeros(size(map));
B(:,3)=map(:,3);

% show images

figure(1)
imagesc(X);
colormap(map);
figure(2)
imagesc(X);
colormap(R);
figure(3)
imagesc(X);
colormap(G);
figure(4)
imagesc(X);
colormap(B);


