%% Volume Data Along Slices
% Show volumetric data along slice planes that are orthogonal to each axis.
% Create slice planes through the volume defined by v = xe^{-x^2-y^2-z^2}, where x, y, and z range from [-2,2]. Create slice planes orthogonal to the x-axis at the values -1.2, 0.8, and 2 and orthogonal to the z-axis at the value 0. Do not create any slice planes that are orthogonal to the y-axis by specifying an empty array.

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

xslice = [-1.2,0.8,2];   
yslice = [];
zslice = 0;
slice(X,Y,Z,V,xslice,yslice,zslice)

% Copyright 2012 The MathWorks, Inc.