How do you randomly transfer one number from an array to a different array without repeats? For example A=[1,........,52] B=[Random numbers from A (1,52) with no repeats]
Afficher commentaires plus anciens
For example A=[1,........,52] B=[Random numbers from A (1,52) with no repeats]
Réponses (1)
Andrei Bobrov
le 19 Oct 2017
Modifié(e) : Andrei Bobrov
le 19 Oct 2017
A = 1:52;
B = A(randperm(numel(A),20));
Catégories
En savoir plus sur Data Types dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!