% Emacs mode header: -*-Octave-*- source. %
% function F int wave len
%  

% script

NL = length(ilist);

lambda = zeros(1,NL);

for iter2 = 1:1:(NL-1)

xI=x(ilist(iter2)); xJ=x(ilist(iter2+1)); %xR=yy(iter+2);

rhtmp = rh(ilist(iter2));     ihtmp = ih(ilist(iter2));
rhtmp1 = rh(ilist(iter2+1)); ihtmp1 = ih(ilist(iter2+1));
lambda(iter2) = ...
abs(atan2(ihtmp,rhtmp) - atan2(ihtmp1,rhtmp1)).*abs(xI-xJ)/2*pi; 

end %---for
