Plot a cyinder with height from one value to another

조회 수: 5 (최근 30일)
F.O
F.O 2017년 11월 4일
댓글: Star Strider 2017년 11월 5일
I want to plot a cylinder with height that goes from -4 to 4 and radius 2?
  댓글 수: 3
F.O
F.O 2017년 11월 5일
Yes, I have read that but it didn't tell you how to change the height or make it go from negative values to positive values which we always have in mathematics problems.

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

채택된 답변

Star Strider
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
F.O
F.O 2017년 11월 5일
Not assignment but i wanted to plot a cylinder with a plane thate intersect with it to calculate the line integral over the curve of intersection
Star Strider
Star Strider 2017년 11월 5일
My code will plot the cylinder, as you requested.
I leave the rest to you.

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

추가 답변 (0개)

카테고리

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

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by