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

Home » Public Forums » archive » Re: Array comparison
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: Array comparison [message #32351 is a reply to message #32348] Wed, 02 October 2002 01:11 Go to previous messageGo to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
Sean Raffuse wrote:
> Hello,
>
> I would like to compare two arrays of different size. What I want to know
> is if the two arrays share ANY of the same values, regardless of index.
>
> e.g.
>
> Array1 = [1,2,3,4,5]
> Array2 = [5,6,7]
>
> Comparing these two arrays should return true because they both have the
> value 5.
>
> I know I could do this in a loop, but I need the speed and I'm sure IDL can
> do this in one line. I'm just not sure how.
>
> Thanks,
>
> Sean Raffuse
>
>

I am using which_indices


http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_source/idl _html/dbase/download/which_indices.tar.gz
or as idl5.5 binary
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_source/idl _html/dbase/download/which_indices.sav


ix=which_indices(Array1,Array2)
print,array1[ix]
5

regards

Reimar

--
Reimar Bauer

Institut fuer Stratosphaerische Chemie (ICG-I)
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
------------------------------------------------------------ -------
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html
============================================================ =======
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Looking for more ideas on code ...
Next Topic: Re: ROI application...

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

Current Time: Fri Oct 10 21:43:18 PDT 2025

Total time taken to generate the page: 0.95142 seconds