How can I custom cylinder rotate axis?
8 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
採用された回答
Matt J
2021 年 9 月 3 日
編集済み: Matt J
2021 年 9 月 4 日
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 件のコメント
参考
カテゴリ
Help Center および File Exchange で Graphics Performance についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!