MATLAB: How to generate a coneplot with a non-uniform grid

coneplotgridMATLABmeshgridnon-uniform

How do I generate a coneplot with a non-uniform grid?

Best Answer

The function CONEPLOT(X,Y,Z,U,V,W,Cx,Cy,Cz) plots velocity vectors as cones at the points (Cx,Cy,Cz) in the vector field defined by U,V,W. The arrays X,Y,Z define the coordinates for U,V,W and must be monotonic and 3D plaid (as if produced by MESHGRID). You should be able to use a grid that is non-uniformly distributed, as long as it meets these requirements. The following simple example demonstrates the use of a non-uniformly distributed grid:
[x,y,z]=meshgrid([0 10 15 30 60],[0 10 30 50 60],[-10 -8 0 2 10]); % non-uniform

[u,v,w]=meshgrid([0 5 11 12 20],[0 5 13 15 20],[0 7 19 20 25]); % non-uniform
cx=1;
cy=2;
cz=3;
surf(peaks)
h1=coneplot(x,y,z,u,v,w,cx,cy,cz)
set(h1, 'FaceColor', 'blue', 'EdgeColor', 'none')