%% Plot Modified Bessel Functions of First Kind
% Define the domain.

z = 0:0.01:5;

%
% Calculate the first five modified Bessel functions of the first kind. Each row of I contains the values of one order of the function evaluated at the points in z.

I = zeros(5,501);
for nu = 0:4
    I(nu+1,:) = besseli(nu,z);
end

%
% Plot all of the functions in the same figure.

plot(z,I)
axis([0 5 0 8])
grid on
legend('I_0','I_1','I_2','I_3','I_4','Location','NorthWest')
title('Modified Bessel Functions of the First Kind for $\nu \in [0,4]$','interpreter','latex')
xlabel('z','interpreter','latex')
ylabel('$I_\nu(z)$','interpreter','latex')

% Copyright 2015 The MathWorks, Inc.