I created a helix truncated pyramid. Though the helix has some gap on one of the corners of the pyramid. so how to fix it.i attached the cods I used.Thank you!untitled.jpg

 채택된 답변

Adam Danz
Adam Danz 2018년 12월 9일

0 개 추천

A line will be drawn for each column of Tx, Ty and Tz. If you remove the 'b' color definition from your call to plot3(), each line will have its own color and this will be easier to explain.
plot3(Tx,Ty,Tz)
xlabel('x')
ylabel('y')
zlabel('z')
view(0, 90)
181208 185037-Figure 1.jpg
From this view (above), the z axis is collapsed and you can see consentric rectangles. This makes sense because the first and last rows of Tx and Ty contain the same coordinates which is why the rectangles appear to be complete and continuous.
However, the story changes when we rotate the plot to make the z axis visible.
view(-29.6, 0.4)
181208 185319-Figure 1.jpg
Now we see a spiral which isn't a surprise since your z-variable (Tz) wraps the end of each rectanlge to the start of the next rectangle (actually, now we see they are no longer rectanlges). For example, the end of column 1 in Tz is -5 and the start of column 2 in Tz is -5. Nevertheless, the x and y coordinates that define the start of one rectangle and end of the previous rectangle differ (as seen in the first figure above).
That's why at some viewing angles (such as view(-44, 42.8) or (0, 90)), you can see the discontinuity between the rectangluar layers.
If you want the columns of coordinates to produce a continuous spiral, you'll need to change the Tx and Ty variables and I suggest working from the view(0, 90) since your Tz variable is already correctly wrapping to the next level.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

질문:

2018년 12월 8일

댓글:

2018년 12월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by