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?
採用された回答
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 件のコメント
Star Strider
2017 年 11 月 5 日
My code will plot the cylinder, as you requested.
I leave the rest to you.
その他の回答 (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!