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]
Show older comments
For example A=[1,........,52] B=[Random numbers from A (1,52) with no repeats]
Answers (1)
Andrei Bobrov
on 19 Oct 2017
Edited: Andrei Bobrov
on 19 Oct 2017
A = 1:52;
B = A(randperm(numel(A),20));
Categories
Find more on Data Types in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!