How can I custom cylinder rotate axis?
12 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commento
Risposta accettata
Matt J
il 3 Set 2021
Modificato: Matt J
il 4 Set 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 Commenti
Vedere anche
Categorie
Scopri di più su Graphics Performance in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!