%% Specify Colormap Colors
% Specify the colors for a waterfall plot by including a fourth matrix input, C. The waterfall plot uses Z for height and C for color. Add a color bar to the graph to show how the data values in C correspond to the colors in the colormap.

[X,Y] = meshgrid(-3:.125:3);
Z = peaks(X,Y);
C = gradient(Z);
waterfall(X,Y,Z,C)
colorbar

% Copyright 2019 The MathWorks, Inc.
%