How do I fill a 1000*25 length vector with random, non-repetitive numbers from 1 to 1000000?
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Rabeca Mohammed
il 4 Ott 2021
Commentato: Rabeca Mohammed
il 5 Ott 2021
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 Commenti
Risposta accettata
Fangjun Jiang
il 4 Ott 2021
Modificato: Fangjun Jiang
il 4 Ott 2021
a=zeros(1000,25);
a(:)=randperm(1000000, numel(a));
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Random Number Generation in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!