using normrnd function in a loop
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
If I use normrnd function in a loop, every times that normrnd runs in a new loop it will give me the same number? ( if I set parameters to a constant value);
for i = 1 :10
x(i) = normrnd(1,0.2);
end
0 Kommentare
Akzeptierte Antwort
the cyclist
am 12 Sep. 2013
No. It will give a different number on every call (until you reach the end of the pseudorandom generator's period, which is enormous).
0 Kommentare
Weitere Antworten (1)
Azzi Abdelmalek
am 12 Sep. 2013
rng(14) % choose your seed
for i = 1 :10
x(i) = normrnd(1,0.2)
end
0 Kommentare
Siehe auch
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!