[IndexImage, ColorMap] = rgb2ind(RGB)
3D image of a numeric type
2D matrix with the same number of rows and columns as RGB
matrix with three columns and as many rows as RGB contains pixels. Note that this parameter is compulsory.
This function converts an RGB image to an indexed image. This function should be called if a color image is to be displayed with ShowImage.