I=imread('peppers.png'); Ired=I(:,:,1); Igreen=I(:,:,2); Iblue=I(:,:,3); subplot(3,3,2), imshow(I), title('Original image') subplot(334), imshow(Ired), title('R plane BW') subplot(335), imshow(Igreen), title('G plane BW') subplot(336), imshow(Iblue), title('B plane BW') Iredcolor=I; Iredcolor(:,:,2:3)=0; Igreencolor=I; Igreencolor(:,:,1)=0; Igreencolor(:,:,3)=0; Ibluecolor=I; Ibluecolor(:,:,1:2)=0; subplot(337), imshow(Iredcolor), title('R plane color') subplot(338), imshow(Igreencolor), title('G plane color') subplot(339), imshow(Ibluecolor), title('B plane color')