binomp.m
来自「统计分析的软件包」· M 代码 · 共 20 行
M
20 行
function f = binomp(x,n,p);
%BINOMP BINOMP(X,N,P) is the cumulative distribution function at X of the
% binomial distribution with denominator N and success probability P.
% X, N and P must be scalars.
% GKS 13 Aug 95, 6 Aug 98
if n <= 0
error('Binomial denominator must be positive.')
elseif (p < 0) | (p > 1)
error('Binomial probability must be >= 0 and <= 1.')
elseif x >= n
f = 1;
elseif x < 0
f = 0;
else
x = floor(x);
f = betainc( 1-p, n-x, x+1 );
end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?