How can I custom cylinder rotate axis?
8 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi
I have a 2D graph and I want make it 3D via cylinder. but cylender rotating it about x-axis.
is there anyway to change this? for example rotate about y-axis


1 commentaire
Réponse acceptée
Matt J
le 3 Sep 2021
Modifié(e) : Matt J
le 4 Sep 2021
Another approach:
[Xq,Zq]=ndgrid(linspace(-3,3,100));
[~,Rq]=cart2pol(Xq,Zq);
func=@(r) sin(r)./r; %The 1D profile
x=linspace(0,3,100);
y=func(4*x);
Yq=interp1(x,y,Rq); %rotated about Y-axis
surf(Xq,Yq,Zq,'EdgeColor','none')
xlabel 'X', ylabel 'Y', zlabel 'Z'
4 commentaires
Voir également
Catégories
En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



