rand('state',11)
古いコメントを表示
Can anyone please explain this statement:
rand('state',11) ?!
2 件のコメント
Hussein Adel
2020 年 5 月 29 日
no one since 2011 :)
Steven Lord
2020 年 5 月 29 日
No one responded since February 1st, 2018. The answers given then and back in 2011 are still valid.
採用された回答
その他の回答 (4 件)
Wayne King
2011 年 10 月 7 日
did you read that document, it is explained there. It is a seed. The seed is an integer, you can use it to produce repeatable results.
rand('state',11)
rand(4,1)
% now seed back to where you were
rand('state',11)
rand(4,1)
% the same 4 numbers both times, now
rand('state',1)
rand(4,1)
% see they're different
Wayne King
2011 年 10 月 7 日
編集済み: John Kelly
2014 年 5 月 27 日
0 投票
rand('state',seed_number) is an old way of seeding the MATLAB v5 random number generator.
Steven Lord
2018 年 2 月 1 日
0 投票
See this page in the documentation for an explanation of that syntax and the recommended replacement.
yasmine Zem
2021 年 1 月 26 日
0 投票
Bonjour j'ai un problème avec mon algorithme il veut pas marcher je voudrais avoir des explications svp clf
randn ('state',1)
T = 1; N = 2^8; Delta = T/N; lambda = 0.05; sigma 0.8; Xzero = 1;
Xem = zeros (1, N+1);
Xem (1) = Xzero;
for j = 1:N
Winc = sqrt (Delta) *randn;
Xem (j+1)=abs (Xem (j) + Delta*lambda*Xem (j) + sigma\sqrt(Xem (j)) *Winc);
end
plot ( [0:Delta:T],Xem, 'r--') xlabel ('t','FontSize', 16), ylabel ('X', 'FontSize', 16)
カテゴリ
ヘルプ センター および File Exchange で Random Number Generation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!