Re: Sort an Array of Structures... [message #34189] |
Thu, 20 February 2003 16:37 |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
v3ctr4@libero.it (Vectra) writes:
> Hi all, i've an array of structures like that:
>
> X = 5
> Y = 5
> Z = 5
> dumb_struct = { dumb_struct, a: 0, b: 1.0, c: 0 }
> dd = REPLICATE(dumb_struct, X, Y, X)
>
> how can i order the array in ONE variable, say something like
> dd[*,3,3] ordered by the "a" value of each element?
>
> it's correct someting like this?
> dd = dd(SORT(dd[*,3,3].a))
Did you try it?
One question: why do you index the array DD in the inner expression by
[*,3,3], but not the outer expression?
Craig
--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
|
|
|