Fcdf.m (493B)
1 % Fcdf.m -- Calculates F(x) for the F distribution 2 % z = ordinate 3 % m = dof for numerator 4 % n = dof for denominar 5 % The cdf is the integral from 0 to x of Fpdf function 6 % 7 % This routine is taken from p190 of Numerical Recipes and uses the 8 % incomplete beta function. 9 % 10 % m=v1 n=v2 z=F 11 12 function cdf = Fcdf(z,m,n) 13 14 a=n/2; 15 b=m/2; 16 x=n/(n+m*z); 17 18 if (a>=0)&(b>=0)&(x>=0); 19 Q=beta(x,a,b); 20 cdf=1-Q; 21 else; 22 cdf=[]; 23 disp 'Arguments must be nonnegative'; 24 end; 25 26 27