Home > data-vis > supporting_functions > gradcolormap.m

gradcolormap

PURPOSE ^

SYNOPSIS ^

function out = gradcolormap(rgb1, rgb2, n, flag_showcolormap)

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function out = gradcolormap(rgb1, rgb2, n, flag_showcolormap)
0002 out = zeros(n,3);
0003 for i = 1:n
0004     out(i,:) = rgb2*(i-1)/(n-1) + rgb1*(1-(i-1)/(n-1));
0005 end
0006 if exist('flag_showcolormap', 'var') && ~isempty(flag_showcolormap) && flag_showcolormap
0007     figure;
0008     colormap(out);
0009     colorbar;
0010 end
0011 end

Generated on Wed 24-May-2017 00:00:56 by m2html © 2005