You're passing in a color image and imhist() is not set up for that. If you want 3 histograms, extract each color channel independently,
% Extract the individual red, green, and blue color channels.
redChannel = rgbImage(:, :, 1);
greenChannel = rgbImage(:, :, 2);
blueChannel = rgbImage(:, :, 3);
like in the attached demo, and histogram each color channel one at a time. Or if you don't care which color channel, then just lump them all together with (:)
Best Answer