Can i fix a sum of vector generated by Distribution Poisson?

1 回表示 (過去 30 日間)
Safia
Safia 2022 年 9 月 29 日
コメント済み: Safia 2022 年 9 月 29 日
Hello!
i used a function poissrnd to generate an arrival of cars into a segment highway during period T=3600 s .
this is my code:
lambda = 1/7;
v = poissrnd(lambda, 1, 3600);
but the vector v is changed , i want to get the sum(v) as a fixed value because i will use it in matrix.
i ask you if it is possible to do that or not?
thanks in advance.

採用された回答

Torsten
Torsten 2022 年 9 月 29 日
Fix the random seed:
rng('default') % e.g.
lambda = 1/7;
v = poissrnd(lambda, 1, 3600);

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by