Info

此问题已关闭。 请重新打开它进行编辑或回答。

poisson random distributoin with zeros

1 次查看(过去 30 天)
Mohamed Ayman
Mohamed Ayman 2019-10-15
关闭: MATLAB Answer Bot 2021-8-20
i want to generat a poisson random vector with mean 2400 and its diminsion(1000,1) and distribut it randomly in a zeros vector(80000,1)

回答(1 个)

the cyclist
the cyclist 2019-10-15
编辑:the cyclist 2019-10-15
If you have the Statistics and Machine Learning Toolbox, then
BIG = 80000;
SMALL = 1000;
MEAN = 2400;
idx = randsample(1:BIG,SMALL);
output = zeros(BIG,1);
output(idx) = poissrnd(MEAN,SMALL,1);

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by