How to randomly and uniquely select 2000 samples from an array with 1x460800.

1 view (last 30 days)
Any help much appreciated.

Accepted Answer

madhan ravi
madhan ravi on 24 Jun 2019
val(randperm(numel(val),2000))

More Answers (1)

Alex Mcaulley
Alex Mcaulley on 24 Jun 2019
Being A your array and N the number of random samples you want:
B = A(randperm(numel(A),N));

Categories

Find more on Creating and Concatenating Matrices 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!