MATLAB Answers

Md Imp
0

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

Asked by Md Imp
on 24 Jun 2019 at 6:54
Latest activity Commented on by Md Imp
on 24 Jun 2019 at 7:16
Any help much appreciated.

  0 Comments

Sign in to comment.

2 Answers

Answer by madhan ravi
on 24 Jun 2019 at 7:03
 Accepted Answer

val(randperm(numel(val),2000))

  1 Comment

Thank you Madhan Ravi, appreciate it!

Sign in to comment.


Answer by Alex Mcaulley on 24 Jun 2019 at 7:02

Being A your array and N the number of random samples you want:
B = A(randperm(numel(A),N));

  1 Comment

Sign in to comment.