Plot a cyinder with height from one value to another
조회 수: 1 (최근 30일)
이전 댓글 표시
I want to plot a cylinder with height that goes from -4 to 4 and radius 2?
댓글 수: 3
채택된 답변
Star Strider
2017년 11월 5일
I can’t determine if this is a homework assignment or not.
The plot is straightforward:
r = 2;
t = linspace(0, 2*pi);
cyl = [r*cos(t); r*sin(t)];
figure(1)
plot(cyl(1,:), cyl(2,:))
figure(1)
surf([cyl(1,:); cyl(1,:)], [cyl(2,:); cyl(2,:)], [-4*ones(1,size(cyl,2)); 4*ones(1,size(cyl,2))])
grid on
axis equal
댓글 수: 2
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Annotations에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!