How to graph 3 cylinders together.

1 visualizzazione (ultimi 30 giorni)
Joffre Veloz Pazmiño
Joffre Veloz Pazmiño il 16 Set 2022
These are the cylinders:
𝑥^2 + 𝑦^2 = 4; 𝑥^2 + 𝑧^2 = 4; 𝑦^2 + 𝑧^2 = 4

Risposte (1)

KSSV
KSSV il 16 Set 2022
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)

Tag

Prodotti


Release

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by