RGB=imread('peppers.png');%读入图像
%subplot(2,2,1);
imshow(RGB);
r = RGB(:,:,1);
g = RGB(:,:,2);
b = RGB(:,:,3);
figure
plot3(b(:),g(:),r(:),'.')
%bar3(r(:),g(:),b(:))
grid('on')
zlabel('Red (Band 3)');
ylabel('Green (Band 2)')
xlabel('Blue (Band 1)')
title('Scatterplot of the Visible Bands')
figure
subplot(3,1,1);imhist(RGB(:,:,1));title('R直方图')
subplot(3,1,2);imhist(RGB(:,:,2));title('G直方图')
subplot(3,1,3);imhist(RGB(:,:,3));title('B直方图')