MATLAB: How to create a custom dynamic colormap

colormapcustomdynamic

Hi,
I have been wondering about how to create a custom colormap, with a dynamic range similar to the default colormaps in MATLAB. The call to the colorbar will be something like,
customColormap = getCustomColormap(nColors);
It is possible that there is no clear solution to this problems, but it would be great if anyone have an idea to how to proceed.
Best Regards Patrik

Best Answer

Hi!
You can use the command "colormap" to create color maps. The built-in colormaps can be scaled dynamically, like
colormap(jet(nColors))
You can as well build your own color maps. A color map is a m-by-3 matrix of real numbers between 0.0 and 1.0, specifying RGB values.