标题: Matlab中rand('state',s)和rand('state',0)表示什么意思? [打印本页] 作者: Enest13 时间: 2021-5-24 10:01 标题: Matlab中rand('state',s)和rand('state',0)表示什么意思? Matlab中rand('state',s)和rand('state',0)表示什么意思? ; _& Y1 G3 V( M0 @; M7 x作者: regngfpcb 时间: 2021-5-24 15:07
rand('state',s)表示随机产生数的状态state,一般情况下不用指定状态。但是有的书籍作者为了让读者能够看到和他书本的同样结果,采用了设置state,rand('state',0)作用在于如果指定状态,产生随机结果就相同了。作者: yin123 时间: 2021-5-24 15:08
RAND('state',0) resets the generator to its initial state.9 c4 s. B" P& _" a% ]
RAND('state',J), for integer J, resets the generator to its J-th state. 6 I7 B, H4 `, lRAND('state',J) and RAND('state',S) cause the MATLAB 5 generator to be used. 7 u$ f6 {) \. T- W i& Vhelp 里面解释# V# y4 z/ \ _/ E' \7 w# M, {0 l
rand('state',s)Resets the state to s. 3 c/ }& ~/ w. r! a3 b# n( d+ trand('state',0)Resets the generator to its initial state. ! Z. `$ N) x3 f, g2 o
rand('state',j)For integer j, resets the generator to its j-th state.作者: Henriete11 时间: 2021-5-24 17:34
感觉2楼说的好有道理的样子,哈哈哈