How to graph 3 cylinders together.

2 ビュー (過去 30 日間)
Joffre Veloz Pazmiño
Joffre Veloz Pazmiño 2022 年 9 月 16 日
These are the cylinders:
𝑥^2 + 𝑦^2 = 4; 𝑥^2 + 𝑧^2 = 4; 𝑦^2 + 𝑧^2 = 4

回答 (1 件)

KSSV
KSSV 2022 年 9 月 16 日
Youmay modify the belo code and achieve it.
Radius = 2. ; % Radius of the cylindrical
theta = 360. ; % Angle of the Cylinder
Height = 10. ; % Height of the Cylinder
%
NH = 50 ; % Number of Elements on the Height
NT = 100 ; % Number of Angular Dicretisation
nH = linspace(0,Height,NH) ;
nT = linspace(0,theta,NT)*pi/180 ;
[H, T] = meshgrid(nH,nT) ;
% Convert grid to cylindrical coordintes
X = Radius*cos(T);
Y = Radius*sin(T);
Z = H ;
figure
hold on
surf(X,Y,Z)
surf(X,Z,Y)
surf(Y,Z,X)
  1 件のコメント
Joffre Veloz Pazmiño
Joffre Veloz Pazmiño 2023 年 3 月 6 日
It should come out like the first chart.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

タグ

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by