MATLAB Answers

0

What is the use of state in randseed() function?

Sayantan Sur さんによって質問されました 2017 年 9 月 7 日
最新アクティビティ José-Luis
さんによって 回答されました 2017 年 9 月 7 日
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 件のコメント

サインイン to comment.

タグ

1 件の回答

José-Luis
回答者: 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 件のコメント

サインイン to comment.



Translated by