⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 simbinom.m

📁 用matalab开发的随机数生成程序包
💻 M
字号:
function [sample] = simbinom(npoints, n, p)
% SIMBINOM random numbers from binomial distribution
%
% [sample] = simbinom(npoints, n, p)
%
% Inputs: npoints - sample size
%         n - parameter of the distribution, number of trials
%         p - parameter of the distribution, probability of success
%
% Outputs: sample - vector of random numbers
%
% See also SIMDISCR, SIMEXP, SIMGEOM, SIMPARETO

% Authors: R.Gaigalas, I.Kaj
% v1.2 04-Oct-02

  % generate n samples from Bernoulli and sum up
  sample = sum(rand(n, npoints)<p);  

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -