This is the expected behavior of IMHIST. According to the documentation, IMHIST was never meant to accept RGB images. However, in versions of the Image Processing Toolbox prior to 3.2 (R13), IMHIST would follow through execution without erroring out. The results would most likely not be the desired results. IMHIST R13 now errors out so that you will not receive erroneous results.
In order to fix the problem, you will need to read the documentation on IMHIST and understand the image types that it supports. You will basically need to convert your RGB image into a grayscale or indexed image.
For a simple example, you can use the following code as a guide:
rgb = imread('flowers.tif');
gray = rgb2gray(rgb);
figure;
imhist(gray)
Best Answer