3D surface plot with varying x-axis data
9 views (last 30 days)
Show older comments
Hello,
I am having some trouble with the 3d plot commands, and I was hoping someone could help. I am using the phased array system toolbox, and the only option there is to have elements of an array located in the YZ plane. That is, I have elements of a static array evenly spaced on a grid in the YZ plane.
I would like to show the array moving as I scan the array, to visually represent what I am doing with the array. I would like to keep the YZ points the same, and manipulate the x-axis data to move the array.
plot3 is not useful because it does not plot a surface. surf and mesh are not useful, because they expect a grid on the XY plane and the Z heights to vary. I cannot use the delaunay or griddata techniques because my data is not random - it is all on a grid. Because the points stack in the z-axis, griddata and delaunay and others fail trying to make a triangular mesh because the points are collinear.
xPos = [-0.0092 -0.0092 -0.0092 -0.0092 -0.0092 -0.0046 -0.0046 -0.0046 -0.0046 -0.0046 0 0 0 0 0 0.0046 0.0046 0.0046 0.0046 0.0046 0.0092 0.0092 0.0092 0.0092 0.0092];
yPos = [-0.0050 -0.0050 -0.0050 -0.0050 -0.0050 -0.0025 -0.0025 -0.0025 -0.0025 -0.0025 0 0 0 0 0 0.0025 0.0025 0.0025 0.0025 0.0025 0.0050 0.0050 0.0050 0.0050 0.0050];
zPos = [0.0050 0.0025 0 -0.0025 -0.0050 0.0050 0.0025 0 -0.0025 -0.0050 0.0050 0.0025 0 -0.0025 -0.0050 0.0050 0.0025 0 -0.0025 -0.0050 0.0050 0.0025 0 -0.0025 -0.0050];
Those coordinates should show a flat rectangular plate rotated about the z-axis, but as mentioned, I can't get this to plot as a surface with plot3, nor can I get surf, mesh, griddata, or delaunay to work.
Any help would be greatly appreciated.
Thanks,
~Chuck
0 Comments
Accepted Answer
Walter Roberson
on 2 Jan 2014
Create a hgtransformgroup and
surf(y, z, x, 'Parent', that handle)
then set the rotation matrix on the transform group to permute the axes as required. See makehgtransform
More Answers (0)
See Also
Categories
Find more on Surface and Mesh Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!