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

조회 수: 12 (최근 30일)
Sayantan Sur
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?

답변 (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.

카테고리

Help CenterFile Exchange에서 Tracking and Motion Estimation에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by