%% Contours at Ten Levels
% Define Z as a function of two variables, X and Y. Then display contours at 10 levels of Z.

x = linspace(-2*pi,2*pi);
y = linspace(0,4*pi);
[X,Y] = meshgrid(x,y);
Z = sin(X) + cos(Y);
contourf(X,Y,Z,10)

% Copyright 2018 The MathWorks, Inc.