How to rotate a function about the y-axis

4 Ansichten (letzte 30 Tage)
Katy Pointer
Katy Pointer am 5 Okt. 2011
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 Kommentare
Katy Pointer
Katy Pointer am 5 Okt. 2011
Isn't that the same thing? Then I can do mesh(matrix) to get the plot.
Jan
Jan am 5 Okt. 2011
You can plot a matrix. But rotating the Bessel function leads to a circular shape, not to a rectangular matrix.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Teja Muppirala
Teja Muppirala am 5 Okt. 2011
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;
  1 Kommentar
Katy Pointer
Katy Pointer am 5 Okt. 2011
That's amazing! Thank you. I had tried something similar, but didn't quite get the radius bit right. Thanks so much :)

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (2)

Patrick Kalita
Patrick Kalita am 5 Okt. 2011

Jan
Jan am 5 Okt. 2011
What about using AIRY?
v = -20:0.1:20;
m = bsxfun(@plus, v, i*v');
Z = airy(m);

Kategorien

Mehr zu Bessel functions finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by