MATLAB: How to convert RGB gcf to grayscale gcf

colormapgraygrayscaleheatmaprgbrgb2gray

h = rand(10)
heatmap(h)
i want to using 'rgb2gray' without using imread.
The mechanism I want is to create heatmap and set it in set(gcf,~~~~).
How can I do it ?

Best Answer

h = rand(10)
heatmap(h) ;
colormap(gray)