function resulting_vector = Calc_Mid_L(L,ll)

last_L = numel(L);
last_small_l = numel(ll);

%---------------------------
% Calculates first interval
%   
first_diff = ll(3)-ll(2);
for ind = 2:5               % (age = 1:4 )
	resulting_vector(ind) = ll(2)+ind*first_diff /4;
end
%---------------------------
% Calculates other intervals
%   
for ind = 6: last_L-1          % age = 5:last_age-1
	x0 = mod((ind-1),5);
	mult5 = 5*floor((ind-1)/5);
	resulting_vector(ind) = ll(mult5/5+2) + (x0+1)*(ll(mult5/5+3) - ll(mult5/5+2))/5;
end
%---------------------------
% Copies the end points from the input
%   
resulting_vector(1)= L(1);
resulting_vector(last_L)= L(last_L);

