This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% 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