Monte carlo simulation simplification

1 vue (au cours des 30 derniers jours)
Eric Chua
Eric Chua le 13 Mai 2020
Commenté : Eric Chua le 13 Mai 2020
lambda1 = 60.21;
lambda2 = 41.58;
lambda3 = 9.11;
lambda4 = 8.71;
lambda5 = 3.83;
lambda6 = 3.74;
lambda7 = 18.06;
r1 = poissrnd(lambda1)
r2 = poissrnd(lambda2)
r3 = poissrnd(lambda3)
r4 = poissrnd(lambda4)
r5 = poissrnd(lambda5)
r6 = poissrnd(lambda6)
r7 = poissrnd(lambda7
How can I simplify my code to get the same result? Please help

Réponse acceptée

Mario Malic
Mario Malic le 13 Mai 2020
lambda = [60.21, 41.58, 9.11, 8.71, 3.83, 3.74, 18.06]
r = poissrnd(lambda)

Plus de réponses (0)

Catégories

En savoir plus sur MATLAB Coder dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by