Home > . > p2toperc.m

p2toperc

PURPOSE ^

SYNOPSIS ^

function y=p2toperc(x)

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function y=p2toperc(x)
0002   
0003   n = size(x,1);
0004   y = zeros(n,1);
0005   
0006   for i=1:n
0007 %    if x(i,6) == 0  have to wait until the 2nd part works
0008     if 1
0009       y(i) = x(i,3);
0010     else
0011       if x(i,3) < x(i,2)
0012     p = 0.05;
0013       else
0014     p = 0.95;
0015       end
0016     
0017       if x(i,1) == 1
0018     y(i) = fsolve(@fbeta,1,p,x(i,2),x(i,3));
0019       elseif x(i,1) == 2
0020     y(i) = fsolve(@fgamma,1,p,x(i,2),x(i,3));
0021       elseif x(i,1) == 3
0022     y(i) = (x(i,3)-x(i,2))/qnorm(p,0,1);
0023       elseif x(i,1) == 4
0024     y(i) = fsolve(@figamm,1,p,x(i,2),x(i,3));
0025       elseif x(i,1) == 5
0026 %    y(i) = fsolve(@fgamma,1,p,x(i,2));
0027       end
0028     end
0029   end

Generated on Fri 16-Jun-2006 09:09:06 by m2html © 2003