%% Vertex Spacing That Follows Streamline Gradient
% Plot streamlines to show vertex spacing as it changes with the gradient along the streamline.

z = membrane(6,30);
[u,v] = gradient(z);
pcolor(z);
hold on
[verts,averts] = streamslice(u,v);
iverts = interpstreamspeed(u,v,verts,15);
sl = streamline(iverts);
set(sl,'Marker','.');
shading interp
axis tight 
view(2);
daspect([1,1,1]);
hold off

% Copyright 2012 The MathWorks, Inc.