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 日間)
slama najla
slama najla 2012 年 9 月 18 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
hello, can any one tell me how can i generate a pseudomrandom sequence in matlab that was fixed any

回答 (1 件)

the cyclist
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.

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by