Po = 1; % define Po
a = 0.2; % define a
L = 0:10/100:10 % make a vector L with 100 elements evenly spaced from 0 to 10
%option 1, compute P(L) one element at a time
for i = 1:length(L) %loop through all values of L
P1(i) = Po*exp(-a*L(i));
end
%option 2, compute all the values at once
P2 = Po*exp(-a*L);
figure;plot(L,P1) % Plot P vs L