rand('state',s)表示随机产生数的状态state,一般情况下不用指定状态。但是有的书籍作者为了让读者能够看到和他书本的同样结果,采用了设置state,rand('state',0)作用在于如果指定状态,产生随机结果就相同了。
rand('state',s)Resets the state to s.
rand('state',0)Resets the generator to its initial state.
rand('state',j)For integer j, resets the generator to its j-th state.