필터 지우기
필터 지우기

accurate 3 D plotting

조회 수: 2 (최근 30일)
ruthwic
ruthwic 2017년 9월 20일
답변: Chad Greene 2017년 9월 20일
Hi I am trying to pot 3D shape of a pipe with radius 1, by when I try to plot it in surf it is forming triangulations but not a smooth surface, can anyone help me in forming a shape of the circular pipe, thanks in advance.
x0 = 0;
y0 = 0;
t=0:1:90;
l=ones(9,90)
z=zeros(9,90);
x=zeros(9,90);
y=zeros(9,90);
for s=1:9
for i=1:1:90
x(s,i) = l(s,i).*cos(t(i));
y(s,i) = l(s,i)*sin(t(i));
z(s,i)=s
end
end
surf(x,y,z)
set(gcf, 'units','normalized','outerposition',[0 0 1 1]);
fontSize = 15;
xlabel('X', 'FontSize', fontSize);
ylabel('Y', 'FontSize', fontSize);
zlabel('Z', 'FontSize', fontSize);

답변 (1개)

Chad Greene
Chad Greene 2017년 9월 20일
I think it'd be easier to use the cylinder function or there a few entries on File Exchange that might help (e.g. TubePlot).

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by