怎样用MATLAB程序产生一组随机数服从泊松分布?

2025-03-05 05:27:31
推荐回答(2个)
回答1:

看看这个程序怎么处理:function x=poisondist(x0,lamda,n)format long;x=zeros(n,1);for i=1;n; b=1; tol=1; k=0; while tol==1 r=mixmod(x0,10,1); b=b*r(10); if b

回答2:

Matlab中直接提供了泊松分布随机数的生成函数poissrnd Poisson random numbersR = poissrnd(lambda)R = poissrnd(lambda,m)R = poissrnd(lambda,m,n)生成以lambda为参数的1×1或m×m或m×n的泊松分布随机数