MATLAB: How to color map the RGB matrices

matlab colormap colorbar rgb conversion

Hi. for example i have matrices that has values (RGB) 0-255
a=255 255 0
b=0 255 255
c=180 255 90
how do i generate a color map and a color bar (from a to c) out of this?

Best Answer

Try this:
cmap = [a;b;c];
colormap(axesHandle, cmap);
colorbar;