Info
此问题已关闭。 请重新打开它进行编辑或回答。
hello, can any one tell me how can i generate a pseudomrandom sequence in matlab that was fixed any time i execute the program
1 次查看(过去 30 天)
显示 更早的评论
hello, can any one tell me how can i generate a pseudomrandom sequence in matlab that was fixed any
0 个评论
回答(1 个)
the cyclist
2012-9-18
编辑:the cyclist
2012-9-18
If you have a relatively recent version of MATLAB, use the rng() command to fix the seed. For example, place the line
rng(1)
at the beginning of your code.
Then you can use
rand(3,1)
for example to generate three pseudorandom numbers uniformly from the interval (0,1). Functions for drawing from other distributions are also available.
0 个评论
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!