How to use "poissrnd" function?

16 ビュー (過去 30 日間)
Maria
Maria 2022 年 10 月 4 日
編集済み: Torsten 2022 年 10 月 5 日
Hello!
I'm trying to use "poissrnd" function in order to generate an arrival of task each minute. But i use a time frame in second.
lambda = 4;
v = poissrnd(lambda, 1, 3600);
with this command , i get an arrival each second, but i want the result "task/ min"
T=3600 and taux =1 s
lambda = 4 task/ min
i will be grateful if you could find me a solution! Thank you in advance

回答 (1 件)

Torsten
Torsten 2022 年 10 月 4 日
編集済み: Torsten 2022 年 10 月 5 日
lambda = 4
What is the unit of lambda ? Mean number of arrivals per minute ?
And you want to get a random vector for arrivals in each second ?
Note that the "3600" in the line
v = poissrnd(lambda, 1, 3600);
has nothing to do with time units (seconds in this case). It's only the number of random values "poissrnd" should return.
  25 件のコメント
Torsten
Torsten 2022 年 10 月 4 日
編集済み: Torsten 2022 年 10 月 4 日
You already used all 60 for the other positions.
If you want a value at position 3600, v must be of size 61:
v = rand(1,61);
m = zeros(1,3600);
m(1) = v(1);
m((1:60)*60) = v(2:61);
All this confusion is unnecessary. The usual way is to put values at positions 1, 61, 121, ..., 3541. Then the distance between the non-zero elements is the same throughout the vector (60) and v has the usual size 1x60.
Maria
Maria 2022 年 10 月 5 日
@Torsten okay! i really appreciate your effort ant time, thank you for your help

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by