필터 지우기
필터 지우기

using normrnd function in a loop

조회 수: 1 (최근 30일)
mim
mim 2013년 9월 12일
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

채택된 답변

the cyclist
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).

추가 답변 (1개)

Azzi Abdelmalek
Azzi Abdelmalek 2013년 9월 12일
rng(14) % choose your seed
for i = 1 :10
x(i) = normrnd(1,0.2)
end

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by