Extract the separate color channels:
% Extract the individual red, green, and blue color channels.
redChannel = rgbImage(:, :, 1);
greenChannel = rgbImage(:, :, 2);
blueChannel = rgbImage(:, :, 3);
then call unique() and if the length is 1, it's homogenous in that color channel
if length(unique(redChannel)) == 1
% Only one color so it's homogenous
end
Or you could check the variance
if var(redChannel(:)) == 0
Or you could call std() or imhist(). There are a multitude of ways.