0

I was trying to find the next seed of the random PN sequence using mersenne twister generator. my code is below-

N=10;
R=5; 

A(1:N,1:N) = eye(N); 
seed=2; 
rng(seed,'twister');
B = round((rand(25,50)));

C=[A;B];

I am initializing first seed=2 but I want to know what the next seed sequence? I do not know what should be the code for finding the next seed?

I was reading some papers but cannot find my solution. Need expert solution regarding this issue.

Blair rick
  • 13
  • 2
  • What exactly do you want to do? Do you want to generate the same random number sequence again? Why do you concatenate A and B? – Autonomous Nov 03 '15 at 03:15
  • I have no problem with my code. I just want to know what is the next seed according to my twister generator? – Blair rick Nov 03 '15 at 03:28
  • 1
    I have no idea what you're asking or trying to do. The seed is user-specified. It makes no sense to ask which value is next. Are you trying to find the next pseudorandom value that will be produced by the generator, `rand`? Also, `A = eye(N);` is sufficient to allocate an identity matrix. – horchler Nov 03 '15 at 14:58
  • There is no next seed. A seed is just the starting point of a Pseudo-Random Number Generator sequence, you should only start it once unless you really know what you're doing and want to pull some clever tricks with correlation induction. The seed is used to produce an internal state for the PRNG, which is in turn transformed by a messy algorithm into a new state. Mersenne twister then maps the current state to a lower dimensional result to produce the next value you see each time you invoke `rand`. – pjs Nov 03 '15 at 16:25

0 Answers0