using normrnd function in a loop
1 回表示 (過去 30 日間)
古いコメントを表示
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 件のコメント
採用された回答
the cyclist
2013 年 9 月 12 日
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 件のコメント
その他の回答 (1 件)
Azzi Abdelmalek
2013 年 9 月 12 日
rng(14) % choose your seed
for i = 1 :10
x(i) = normrnd(1,0.2)
end
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Loops and Conditional Statements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!