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 Center および File ExchangeSurface and Mesh Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by