MATLAB: What should I do to convert matrix X and map in imread function into the way it suppose to be???

imread

when I use imread(X, map)… function for a picture and write whos, matrix X and matrix map suppose to be a [n m] and [n 3] respectively. However, when I do it, matrix X and map will be shown as [n m 3] and [0 0] respectively! what should I do to convert it into the way it suppose to be????

Best Answer

The map is returned as empty if it is a truecolor image. If you want to convert it to an indexed image for some reason, use rgb2ind()