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

Home » Public Forums » archive » Re: arrays as subscripts
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: arrays as subscripts [message #30804 is a reply to message #30803] Thu, 16 May 2002 20:39 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
lyubo (lzagorch@cs.wright.edu) writes:

> Suppose I have 3 arrays with the same dimensions: A, B and C.
>
> I have to use the non zero elements of A as index to access B, then use
> the accessed values from B as index to access C, and finally store the
> values from C in a new array at the previously indexed positions of B.
>
> Is there an effective way to do that in IDL? I can write a call to a
> C function but I was wondering if I can do it only in IDL.
>
> Any examples and help would be appreciated.

I'm doing this after a couple of beers, so...

I = Where(A GT 0, count)
IF count GT 0 THEN BEGIN
bindex = b[i]
b[i] = c[bindex]
ENDIF

Cheers,

David

--
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Digital maintenance handbook
Next Topic: Re: Digital maintenance handbook

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

Current Time: Sat Oct 11 13:57:28 PDT 2025

Total time taken to generate the page: 0.80428 seconds