MATLAB: How to use colorbar and colormap

colorbarcolormapimage processingImage Processing Toolbox

How to set the color at image same as color at color bar? How color map works?

Best Answer

clear; clc;
I = imread('cameraman.tif');
imagesc(I); colormap(jet); colorbar;