how to fix random seed in inbuilt ga in matlab

I am trying to use inbuilt ga to use some objective. for running the results varies, so i would like to get the same results that i got last time. for this random seed is used to fix random number generator so that the results are same for a seed value. please help me in this

답변 (1개)

kjetil87
kjetil87 2013년 7월 24일
편집: kjetil87 2013년 7월 24일

0 개 추천

Create a seed and use that.
init=100;
mySeed=RandStream.create('mt19937ar','seed',init);
now you can either use
numb=rand(mySeed,[m,n]); % m, n desired size
or you can set it as default by:
RandStream.setDefaultStream(mySeed); % for newer versions use setGlobalStream

카테고리

도움말 센터File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

제품

태그

질문:

2013년 7월 24일

Community Treasure Hunt

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

Start Hunting!

Translated by