How to rotate a function about the y-axis
조회 수: 4 (최근 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개)
Jan
2011년 10월 5일
What about using AIRY?
v = -20:0.1:20;
m = bsxfun(@plus, v, i*v');
Z = airy(m);
댓글 수: 0
참고 항목
카테고리
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!