%% Display Curl and Angular Velocity in One Plane
% 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 curl and angular velocity of the vector field.

[curlx,curly,curlz,cav] = curl(x,y,z,u,v,w);

% Show a 2-D slice of the computed curl and angular velocity. Slice the data at z(:,:,1), where the z-coordinate is equal to -0.002.

k = 1;
xs = x(:,:,k); 
ys = y(:,:,k); 
zs = z(:,:,k); 
us = u(:,:,k); 
vs = v(:,:,k); 

% Plot the angular velocity in 2-D coordinates using pcolor. Show the x- and y-components of the vector field using quiver.

pcolor(xs,ys,cav(:,:,k))
shading interp
colorbar
hold on
quiver(xs,ys,us,vs,'k')
hold off

% Next, plot the components of the 3-D curl at the sliced xy-plane.

quiver3(xs,ys,zs,curlx(:,:,k),curly(:,:,k),curlz(:,:,k),'b')
view(0,90)

%
% Copyright 2012 The MathWorks, Inc.