hcrisp
02-11-2011, 11:49 AM
Let's say I have a vector for known, unique indices, but I want to address them one at a time in random order. Is there a PV-WAVE function that will generate this random index vector with one call? I looked in the Stats manual, but none of the Random Number Generation routines seem capable of doing this. Uniform distribution is fine.
ids = LINDGEN(25)
; I want a function that does this:
; rnd_ids = RANDOM_ORDER(ids)
; PRINT, rnd_ids
; 23, 2, 15, 0, 17, 1, etc.
ids = LINDGEN(25)
; I want a function that does this:
; rnd_ids = RANDOM_ORDER(ids)
; PRINT, rnd_ids
; 23, 2, 15, 0, 17, 1, etc.