comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » "splitting" an index
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
"splitting" an index [message #33318] Mon, 16 December 2002 08:39
Carsten Pathe is currently offline  Carsten Pathe
Messages: 5
Registered: December 2002
Junior Member
Hello everybody,

may be it is a simple beginner-question, but anyway ...
How can I "split" an index to a value within a structure consisting of
several floating arrays to acess structure on one specific position?
This example should make it easier to understand, what I want to have:

strcut1 = {a: floatarr(20), b: floatarr(20)}
strcut2 = replicate(struct1, 10)

struct2[3].b[4] = 5

ind = where(struct.b eq 5)

I can�t use this index to acess the data at the correct position to get the
value 5 back. Somehow, I have to "split" the index into two parts.

That�s why I have this "work-around":

tmp = struct2[*].b[*]
ind = where(tmp eq 5)
tmp[ind] = ....... ;do something with the value
struct2[*].b[*] = tmp

Is there another, more elegant or faster way to do this?

Thank you very much for helping me!
Ciao, Carsten
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: RANDOM question
Next Topic: RANDOM question

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:48:52 PDT 2025

Total time taken to generate the page: 0.00525 seconds