I have generated a large dataset. Now I need to draw random samples from it. How can I do this?
Mostrar comentarios más antiguos
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?
Respuesta aceptada
Más respuestas (1)
Grzegorz Knor
el 15 de Nov. de 2012
For example:
data = exp(-(-10:0.1:10).^2);
idx = randperm(numel(data));
N = 20;
idx = idx(1:N);
plot(idx,data(idx),'o')
Categorías
Más información sobre Logical en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!