MATLAB: I have generated a large dataset. Now I need to draw random samples from it. How to do this

MATLABrandom samples

For simulation, I have to draw 1000 random samples from a large dataset. I am looking for some efficient way of doing this. Can anyone help, please?

Best Answer

For dataset w
p = randperm(length(w)); % Reshuffle their order randomly
z = w(p(1:N)); % Choose the first N of these
Related Question