matlab 图像色彩的显示

matlab 图像颜色的显示matlab figure中的图像根据每点的pixel可以显示为rgb色彩的图像,但是要在colorbar中

matlab 图像颜色的显示

matlab figure中的图像根据每点的pixel值可以显示为rgb色彩的图像,但是要在colorbar中显示,则需要将图像的rgb值通过函数映射,比如:matlab 图像色彩的显示jet hsv hot cool spring summer autumn winter gray bone copper pink lines 产生一个单调的映射才行(具体的help colormap);
函数调用时:        figure,[x,y,z]=peaks;
        mesh(x,y,z);
        colormap(cool)
        axis([-3  3  -3  3  -6  8])
        colorbar
修改colormap(cool),中的cool为其他映射即可。