%% Use a Section of the Colormap
% After getting the colormap array, you can isolate a section of it to use as the color scheme.
% Create a surface plot of a plane.

[X,Y] = meshgrid(-10:1:10);
Z = X + Y;
surf(X,Y,Z);

%
% Get the colorcube colormap array, and isolate the red section (entries 39 to 44). Then use this section to color the whole surface.

c = colorcube;
c = c(39:44,:);
colormap(c);

% Copyright 2012 The MathWorks, Inc.