using normrnd function in a loop
显示 更早的评论
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
采纳的回答
更多回答(1 个)
Azzi Abdelmalek
2013-9-12
rng(14) % choose your seed
for i = 1 :10
x(i) = normrnd(1,0.2)
end
类别
在 帮助中心 和 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!