1.
1)
.
ind2rgb 函数
>> [X,map]=imread('trees.tif');
>> imshow(X),imshow(map)
>> figure,imshow(X,map)
>> figure,imshow(X,jet(32));
2)
.
mat2gray 函数
>> I=imread('rice.png');
>> J=filter2(fspecial('sobel'),I);
>> K=mat2gray(J);
>> imshow(I);
>> imshow(K)
>> figure,imshow(K)
3)
.
grayslice 函数
>> I=imread('snowflakes.png');
>> X=grayslice(I,16);
>> imview(I)
> In imview at 16
>> imview(X,jet(16))
In imview at 16