3D surface plot with varying x-axis data

조회 수: 10 (최근 30일)
Charles
Charles 2014년 1월 2일
댓글: Charles 2014년 1월 16일
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

채택된 답변

Walter Roberson
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
  댓글 수: 1
Charles
Charles 2014년 1월 16일
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.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by