3D plotting of given parametric equations
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Ahmet Turan
el 21 de Jun. de 2022
Comentada: Ahmet Turan
el 22 de Jun. de 2022
Hi everyone, I need 3D plot of given parametric equations:
Here also R varies between [25 75], i tried to use meshgrid and ndgrid functions but had a problem using them with varying 3 variables U, V and R. How can i plot this? Also, 3D plot should look like this: (Don't mind numbers they are different in my case)
Thank you in advance
0 comentarios
Respuesta aceptada
KSSV
el 21 de Jun. de 2022
m = 50 ; n = 50 ;
p = 5 ;
u = linspace(0,pi,m) ;
v = linspace(0,2*pi,n) ;
r = linspace(25,75,p) ;
[U,V,R] = meshgrid(u,v,r) ;
Z = R.*cos(U).*cos(V) ;
Y = R.*cos(U).*sin(V) ;
X = sqrt(R.^2-Z.^2-Y.^2);
figure
hold on
for i = 1:p
mesh(abs(X(:,:,i)),Y(:,:,i),Z(:,:,i))
end
view(3)
4 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Surface and Mesh Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!