What is the use of state in randseed() function?
12 次查看(过去 30 天)
显示 更早的评论
out = randseed(state,m,n,rmin,rmax) What is the use of state in randseed? And how it makes a difference to the output value?
0 个评论
回答(1 个)
José-Luis
2017-9-7
Random numbers in Matlab are not random. They are pseudo-random: they are based on deterministic algorithms.
You can consider the seed as the starting point for the random number generation.
If you use the same starting point, you will get the same sequence of random numbers.
Just do an experiment.
Call rand two times. You get two different numbers.
Start Matlab. Call rand. Start Matlab. Call rand. You will get the same number: that's because the seed has been reset.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Tracking and Motion Estimation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!