How to rotate a function about the y-axis
3 次查看(过去 30 天)
显示 更早的评论
I wonder if anyone can help.
I have a Bessel function defined from x=0:20. I am trying to rotate it about the y-axis, so I can get a plot which resembles an Airy function.
I am struggling to write a for loop which will do this. Does anyone have a suggestion or pointers?
Thank you
6 个评论
Jan
2011-10-5
You can plot a matrix. But rotating the Bessel function leads to a circular shape, not to a rectangular matrix.
采纳的回答
Teja Muppirala
2011-10-5
Something like this maybe?
[X,Y]=meshgrid(-20:0.1:20);
R = sqrt(X.^2 + Y.^2);
J=besselj(1,R);
Z=(J./R);
Z(isnan(Z)) = 0.5; %Fix the divide by zero problem
surf(X,Y,Z);
shading flat;
camlight;
更多回答(2 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Bessel functions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!