3D surface plot with varying x-axis data
10 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Walter Roberson
2014-1-2
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
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Surface and Mesh Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!