Undefined function 'log' for input arguments of type 'uint8'
问题 i have been trying generate an image. C1 = imread(InputImage); NumberOfGrayLevels=32; I= 0.299*C1(:,:,1)+0.587*C1(:,:,2)+0.114*C1(:,:,3); C = 0; I=(C*log(I+1))'; new=uint8(mat2gray(I)*(NumberOfGrayLevels-1)); [m,n]= size(new); rgb = zeros(m,n,3); rgb(:,:,1) = new; rgb(:,:,2) = rgb(:,:,1); rgb(:,:,3) = rgb(:,:,2); new = rgb/256; imshow(new,[]); no9=figure; image(new); the error is showing at I=(C*log(I+1))';..can you tell me how to solve this? 回答1: Most probably C1 is of type uint8 . You