Filter löschen
Filter löschen

how to get same values when using random function

2 Ansichten (letzte 30 Tage)
Elysi Cochin
Elysi Cochin am 31 Dez. 2013
Beantwortet: Walter Roberson am 31 Dez. 2013
is it possible to get same values when using random function....
that is, when i do rand(4)
i should always get same value whenever i execute... is it possible, if possible can someone help me how to do it.... i'm using matlab 7.9..... please do reply...

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 31 Dez. 2013
If you want to reproduce a sequence of random values, see rng() to set the random number seed.
If you want to have rand() return the exact same value every time it is called, then create your own rand() routine and have it earlier on the MATLAB path than the standard rand() routine.

Weitere Antworten (0)

Kategorien

Mehr zu Get Started with MATLAB finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by