%% Draw Contours in Slice Planes
% Create multiple slice planes through volumetric data. Draw contours of the data values in each of the slice planes. Let MATLAB choose the contour levels.
% Create V as an array of volume data defined by v = xe^{-x^2-y^2-z^2}. Draw contours in three slice planes that are orthogonal to the x-axis at the values -1.2, 0.8, and 2. Do not create any slice planes that are orthogonal to the y-axis or z-axis by specifying empty arrays. Change the axes view to a 3-D view and add grid lines.

[X,Y,Z] = meshgrid(-2:.2:2);
V = X.*exp(-X.^2-Y.^2-Z.^2);

xslice = [-1.2,0.8,2];   
yslice = [];
zslice = [];
contourslice(X,Y,Z,V,xslice,yslice,zslice)
view(3)
grid on

% Copyright 2012 The MathWorks, Inc.