% plotj0: creates a plot and finds the first n zeros of the bessel function J0 % % define the coordinate systems % z=0:.1:20; % set z from 0 to 20 %%% % define an "inline function for J0" %%% J0=inline('besselj(0,z)'); %%% % plot J0(z) %%% plot(z,J0(z)); grid; xlabel('z'); title('J0(z)'); %%%%%%%%%%%%%%%%%%%%5 % now find the first 3 zeros of Jm(z) %%%%%%%%%%%%%%%%%%%%%% n=3; %(find n zeros) zguess=2 ; % estimate of first zero of J0 for i=1:n z0n(i)=fzero(J0,zguess); zguess=z0n(i)+3; end disp(sprintf('First %d zeros of J0 are',n)); z0n'