StatsReSample *without* replacement
doNNNald
I'm working on a piece of code where I need to take an array and randomize it.
I see that there is a function statsresample that will resample the data, but it does so *with* replacement. Is there a flag or a similar command that will do it *without* replacement?
Basically, I would like to know if there is an analogous function to MATLAB's randsample()
thanks!
d
Function getRandomPoints(inWave,numPoints)
Wave inWave // the wave from which you want to sample
Variable numPoints // the number of points you want at the output
Make/O/N=(numPnts(inWave)) tmpWaveN=enise(1)
Duplicate/O inWave, randomOrderWave
Sort tmpWaveN,randomOrderWave
Redimension/N=(numPoints) randomOrderWave
KillWaves/Z tmpWaveN
End
A.G.
WaveMetrics, Inc.
April 27, 2009 at 12:25 pm - Permalink