% Using MATLAB example

load wind

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

k = 1; % Select plane slice to plot. In this case, the xy plane at z(1)
xs = x(:,:,k); 
ys = y(:,:,k); 
zs = z(:,:,k); 
us = u(:,:,k); 
vs = v(:,:,k); 

pcolor(xs,ys,cav(:,:,k)) % Plot angular velocity of curl of vector field slice
shading interp
colorbar
hold on
quiver(xs,ys,us,vs,'k') % Plot vector field.
hold off

figure % Plot curl of vector field slice.
quiver3(xs,ys,zs,curlx(:,:,k),curly(:,:,k),curlz(:,:,k),'b')
view(0,90)

figure % Plot curl of full vector field.
quiver3(x,y,z,curlx(:,:,:),curly(:,:,:),curlz(:,:,:),'b')

% Plot curl of curl (!) of vector field slice.
[curlcurlx, curlcurly, curlcurlz, ~] = curl(x,y,z,curlx,curly,curlz);
figure 
quiver3(xs,ys,zs,curlcurlx(:,:,k),curlcurly(:,:,k),curlcurlz(:,:,k),'b')
view(0,90)