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

Home » Public Forums » archive » Re: Select Equal elements from 2 arrays
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: Select Equal elements from 2 arrays [message #60952] Mon, 23 June 2008 09:46 Go to previous message
ianpaul.freeley is currently offline  ianpaul.freeley
Messages: 18
Registered: March 2007
Junior Member
On Jun 23, 10:46 am, maffie <matthias.demuz...@geo.kuleuven.be> wrote:
> Yes...but the manual also states further on:
>
> c = 1 2 3 4 5 5 4 3 2 1
> d = 0 2 4
> Subscripts of c that equal d: 1
>
> Note that WHERE found only one element in the array d that equals an
> element in array c. This is because only the first three elements of c
> were searched, since d has only three elements.
>
> That is where my problem is...all the common elements are after the
> number of elements in the smallest array..So they are missed by the
> statement....I have tried many other things, also something like:
> common_indices = indices(Uniq(indices, indices(sort(indices)))
>
> But also this doesn't seem to work...
>
> Any other ideas or suggestions???

yes, just use the match function from the astronomy users library.
http://idlastro.gsfc.nasa.gov/

A = [0,8,16,60,36,49,60]
B =[1,8,33,36,49]
match, a,b,suba,subb
print, 'matching values =', a(suba)
print, 'should be the same values = ', b(subb)
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Select Equal elements from 2 arrays
Next Topic: IDL_IDLbridge, status

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

Current Time: Wed Oct 08 19:12:45 PDT 2025

Total time taken to generate the page: 0.00707 seconds