标题: Matlab中rand('state',s)和rand('state',0)表示什么意思? [打印本页] 作者: adogpp 时间: 2020-4-13 10:27 标题: Matlab中rand('state',s)和rand('state',0)表示什么意思? 它们是表示什么意思呀,我在论坛中搜索过相似的帖子,可是还是不明白,谁能帮我举例说明一下,非常感谢!7 w6 }% H2 |8 U% C |' `( v/ F 作者: yin123 时间: 2020-4-13 20:09
# v' m$ V& H- C. `' f
RAND('state',0) resets the generator to its initial state. 6 c2 f' d# z! _RAND('state',J), for integer J, resets the generator to its J-th state.3 G8 C: u# z5 m1 ^0 T4 T
RAND('state',J) and RAND('state',S) cause the MATLAB 5 generator to be used./ q% m8 u+ ^$ f! i
help 里面解释 4 h4 i) t. d# {7 Z" p( krand('state',s)Resets the state to s. ) A" {' Q/ a# y* a: [8 xrand('state',0)Resets the generator to its initial state. $ W9 |% H- T4 s# |- W6 U
rand('state',j)For integer j, resets the generator to its j-th state.- |2 F9 T# s2 m+ V$ A/ S8 p5 m5 A 作者: NingW 时间: 2020-4-13 20:09
( Y$ E. A5 x9 z
rand('state',s)表示随机产生数的状态state,一般情况下不用指定状态。但是有的书籍作者为了让读者能够看到和他书本的同样结果,采用了设置state,rand('state',0)作用在于如果指定状态,产生随机结果就相同了。1 }* [* D% d! l" a' Q q0 O