% % BESSPLT.M Sample script file to plot some low-order Bessel Functions % % This is a sample file to generate plots of the zero and first order Bessel % functions - J0(x), J1(x) and Y0(x), Y1(x) % - I0(x), I1(x) and K0(x), K1(x) % % File written by J. R. White, UMass-Lowell (original Nov. 1997) % --> modified slightly (Aug. 1998) % % % getting started clear all, close all % % setup independent variable, but don't evaluate at exactly zero since some % of the functions have a singular point at zero Nx1 = 201; x1 = linspace(eps,10,Nx1); % range for ordinary BF function plots Nx2 = 201; x2 = linspace(eps,4,Nx2); % range for modified BF function plots % % evaluate ordinary Bessel functions f0 = besselj(0,x1); g0 = bessely(0,x1); f1 = besselj(1,x1); g1 = bessely(1,x1); % % evaluate modified Bessel functions F0 = besseli(0,x2); G0 = besselk(0,x2); F1 = besseli(1,x2); G1 = besselk(1,x2); % % now let's plot these curves figure(1) subplot(2,2,1),plot(x1,[f0;g0]),grid axis([0 10 -2 2]); gtext('J0(x)'),gtext('Y0(x)') gtext('J0 and Y0 Bessel Functions') % subplot(2,2,3),plot(x1,[f1;g1]),grid axis([0 10 -2 2]); gtext('J1(x)'),gtext('Y1(x)') gtext('J1 and Y1 Bessel Functions') % subplot(1,2,2),plot(x2,[F0;F1;G0;G1]),grid axis([0 4 0 10]); gtext('I0(x)'),gtext('I1(x)'),gtext('K0(x)'),gtext('K1(x)') gtext('Modified Bessel Functions') % % end of demo %