I want to understand colormap of matlab.
colormap(map) JET Variant of HSV JET(M), a variant of HSV(M), is an M-by-3 matrix containing the default colormap used by CONTOUR, SURF and PCOLOR. The colors begin with dark blue, range through shades of blue, cyan, green, yellow and red, and end with dark red. JET, by itself, is the same length as the current figure's colormap.
It means it shows 0 =dark blue, 1=darkred.
But for 0
f=0
cm = colormap(jet(256));% should I take 256
colorID = max(1, sum(f> [0:1/length(cm(:,1)):1]));
myColor= cm(colorID, :)
myColor = 0 0 0.50
why not ( 0 0 1)%darkblue
f=1
cm = colormap(jet(256));% returns the current color map
colorID = max(1, sum(f> [0:1/length(cm(:,1)):1]));
myColor= cm(colorID, :) % returns your color
myColor = 0.50 0 0
why not( 1 0 0)% darkred
ImageRGB = ind2rgb(Image,colormap)- Cape Code