フィルターのクリア

Plot Independent Planes in 3D Space

19 ビュー (過去 30 日間)
Chris Williams
Chris Williams 2014 年 9 月 7 日
編集済み: Star Strider 2014 年 9 月 7 日
I am trying to plot independent planes in 3D space using one set of coordinates. For example:
clear all;
X = [0 1
0 1];
Y = [0 0
1 1];
Z = [1 1
1 1];
X1 = [0 1
0 1];
Y1 = [0 0
1 1];
Z1 = [0 0
0 0];
surf(vertcat(X, X1), vertcat(Y, Y1), vertcat(Z, Z1),'FaceColor','blue','edgecolor','none');
However, rather than producing separate planes, this produces a Z shape. Where am I going wrong, please?
Note that it must be possible to combine the coordinates into a single set so I can later use surf2stl. Therefore, I cannot just plot one using surf and then use hold on.
Thanks.

回答 (1 件)

Star Strider
Star Strider 2014 年 9 月 7 日
編集済み: Star Strider 2014 年 9 月 7 日
It seems vertcat is the problem. I plotted them separately here using hold (easier to write and debug if necessary), but you could combine them in one line if you want:
X = [0 1
0 1];
Y = [0 0
1 1];
Z = [1 1
1 1];
X1 = [0 1
0 1];
Y1 = [0 0
1 1];
Z1 = [0 0
0 0];
figure(1)
surf(X, Y, Z,'FaceColor','blue','edgecolor','none');
hold on
surf(X1, Y1, Z1,'FaceColor','red','edgecolor','none');
hold off
produces:
  1 件のコメント
Star Strider
Star Strider 2014 年 9 月 7 日
編集済み: Star Strider 2014 年 9 月 7 日
The way I read the surf2stl documentation, it requires separate X, Y, and Z for each surface. A volume such as this would not be compatible with it.

サインインしてコメントする。

カテゴリ

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