% /*** Compute RIGHT critical value of test 
%     given confidence interval for c ***/

function crit=Rcrit(cL,cU,quant)

% local c, Nc, i, j, crit;

c = [seqa(-100,2.5,36);seqa(-10,.5,41)];
Nc = size(c,1);

i = 1;
while (cL>c(i)) && (i<Nc)
    i = i+1;
end

j = Nc;
while (cU<c(j)) && (j>1)
    j = j-1;
end

crit = max(quant(i:j));

end
