Function IMHIST expected its first input, I or X, to betwo-dimensional.
输入是要一个二维矩阵,所以要先把RGB图片转化为灰度图:
imhist(rgb2gray(I));