MATLAB: How can i check that the image is rgb

rgb2gray

i need to use rgb2gray func. but first i need to check that my image is rgb or grayscale..like this :
if XXXXXX
c1=rgb2gray(a);
c=imadjust(c1);
else
c=imadjust(a);
subplot(2,3,1),imshow(a),title('original');
subplot(2,3,2),imshow(c),title('option 1');
end
what should i use insted of XXXXXX ?

Best Answer

Hi
if size(a,3)==3
Related Question