How to graph 3 cylinders together.

2 visualizaciones (últimos 30 días)
Joffre Veloz Pazmiño
Joffre Veloz Pazmiño el 16 de Sept. de 2022
Comentada: Joffre Veloz Pazmiño el 6 de Mzo. de 2023
These are the cylinders:
𝑥^2 + 𝑦^2 = 4; 𝑥^2 + 𝑧^2 = 4; 𝑦^2 + 𝑧^2 = 4

Respuestas (1)

KSSV
KSSV el 16 de Sept. de 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)

Categorías

Más información sobre Surface and Mesh Plots en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by