How to graph 3 cylinders together.

2 次查看(过去 30 天)
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)

类别

Help CenterFile Exchange 中查找有关 Surface 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