%This subroutine finds where the aircraft is ~ stable and computes the average 
%incidence angle, which will be free of pitch and roll variations.
%Note:  this incidence angle has a pitch offset (1.5 deg) due to antenna mount included.

p = reshape(pitch,32*size(roll,2),1);
r = reshape(roll,32*size(roll,2),1);
i = reshape(iang,32*size(roll,2),1);

stable = find(abs(pitch) < 0.01 & abs(roll) < 0.01);
if (stable > 0),cnt = cnt + 1,p(stable);,r(stable);,vals(cnt) = mean(i(stable));,end                            
