%/*** Compute UPPER confidence bound for c ***/

function conf=Uconf(stat,confbelt,sig)

% local cbelt, Nc, belt, i, slope, conf;

%/* Select the appropriate confidence belt */

cbelt = [seqa(-170,2,80);seqa(-10,.25,121)];
Nc = size(cbelt,1);

belt = confbelt(:,sig);

%/* Compute confidence bound */

i = Nc-1;
while (stat<belt(i)) && (i>1)
    i = i-1;
end

slope = (cbelt(i+1)-cbelt(i))/(belt(i+1)-belt(i));
conf = cbelt(i)+slope*(stat-belt(i));

end