What I want to do is that using the sequential state to generate random numbers when given a fix seed and a generator method.e.g. given rng(1),generating some random number and then record the current state which will be used as the initial state of next step (continue generating random numbers in the next loop).
load the state
use the state as the initial state
save the current state
At the end I need this state sequence to repeat my simulations and also ensure I can control the rand numbers of every step within the loop.