Sunday, March 24, 2013

Bessel function J1

The Bessel function J1
% Matlab function to evaluate the 'jinc' function:
% jinc(r) = 2*J_1(2 pi r) / (2 pi r)
% where J_1 is the Bessel function of the first kind, order 1.
%
% Inputs:
% r = values for which the jinc is to be evaluated
% Outputs:
% f = jinc function evaluated at each value specified in r
r = -3:0.003:3;
mask = (r~=0);
% assign values everywhere that r is not equal to zero
%
f(mask) = 2*besselj(1, 2*pi*r(mask))./(2*pi*r(mask));
plot(r(mask),f(mask))

No comments:

Post a Comment