%% Divergence of Vector Volume Data as Slice Planes
% Load a 3-D vector field data set that represents a wind flow. The data set contains arrays of size 35-by-41-by-15.

load wind

% Compute the numerical divergence of the vector field.

div = divergence(x,y,z,u,v,w);

% Display the divergence of vector volume data as slice planes. Show the divergence at the yz-planes with x = 90 and x = 134, at the xz-plane with y = 59, and at the xy-plane with z = 0. Use color to indicate divergence.

h = slice(x,y,z,div,[90 134],59,0);
shading interp
colorbar
daspect([1 1 1]);
axis tight
camlight
set([h(1),h(2)],'ambientstrength',0.6);

%
% Copyright 2012 The MathWorks, Inc.