3D surface plot with varying x-axis data

4 views (last 30 days)
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

Accepted Answer

Walter Roberson
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
  1 Comment
Charles
Charles on 16 Jan 2014
Kind of cheating, I wish I could enter X as a matrix and Y and Z as vectors and that MATLAB would recognize what I want to do. But, it works.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!