MATLAB: Rgb2gray function is giving following error even though i have it in image processing toolbox.

image processing

Best Answer

Rename your script gray.m to something else. gray is the name of a colormap, which is being used by imshow(); the routine you named gray.m is interfering with that.