Plotting a rectangle in 3D space

조회 수: 59 (최근 30일)
Karthik
Karthik 2013년 12월 19일
댓글: Marcelo Soto Thompson 2015년 11월 27일
Hi, Suppose I have four points as p1 = [x1,y1,z];p2 = [x2,y2,z];p3 = [x3,y3,z];p4 = [x4,y4,z];
If these four points form a perfect rectangle,what line of code should I write to plot this rectangle in 3D space?
Thanks.
Karthik

채택된 답변

Walter Roberson
Walter Roberson 2013년 12월 19일
plot3d( [x1 x2 x3 x4 x1], [y1 y2 y3 y4 y1], [z z z z z] )
If, that is, you want it as a line. If you want it as a surface, use patch() instead of plot3d()
  댓글 수: 3
Noam Greenboim
Noam Greenboim 2015년 4월 6일
Which toolboxes are needed? It's not recognized on Matlab R2013a
Marcelo Soto Thompson
Marcelo Soto Thompson 2015년 11월 27일
It should read plot3, not plot3D.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by