필터 지우기
필터 지우기

How do i add a seed

조회 수: 3 (최근 30일)
Brendan Querey
Brendan Querey 2020년 11월 18일
답변: dpb 2020년 11월 18일
I have ten stages and two possible values for each one [0,1] how do i generate 500 random versions of them using a seed in matlab?

답변 (1개)

dpb
dpb 2020년 11월 18일
See <Controlling-random-number-generation> for discussion and links to rng function if it is needed to modify default seed to begin each with a new starting point or to start over from the same point to be able to reproduce previous results (say to aid in debugging rest of code during development).
It's simple enough to generate as many random integers as wanted with
N=500;
rn=randi([0 1],N,1);

카테고리

Help CenterFile Exchange에서 Random Number Generation에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by