How do I fill a 1000*25 length vector with random, non-repetitive numbers from 1 to 1000000?
1 回表示 (過去 30 日間)
古いコメントを表示
I tried numerous ways of doing the above but I keep getting compatibility issues since randperm(1000000) returns a vector of length 1000000 and my created vector is just 1000*25.
0 件のコメント
採用された回答
Fangjun Jiang
2021 年 10 月 4 日
編集済み: Fangjun Jiang
2021 年 10 月 4 日
a=zeros(1000,25);
a(:)=randperm(1000000, numel(a));
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Random Number Generation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!