matlab R2020b randperm fuction is not random
1 回表示 (過去 30 日間)
古いコメントを表示
Hi,
When I use matlab R2020b on linux platform, commands follow:
order = randperm(10)
disp(order)
results show:
6 3 7 8 5 1 2 4 9 10
6 3 7 8 5 1 2 4 9 10
Curiously, the result is fixed,i.e., when I run this script again, the same results appear. Does anybody know what's wrong? thanks
採用された回答
Fangjun Jiang
2022 年 7 月 14 日
Duh! You store the result in "order" and display it again. Of course they are the same!
order = randperm(10)
disp(order)
order = randperm(10)
disp(order)
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Startup and Shutdown についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!