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

Home » Public Forums » archive » Finding Common Elements in Two 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
Finding Common Elements in Two Arrays [message #2111] Wed, 01 June 1994 13:45 Go to previous message
kucera is currently offline  kucera
Messages: 7
Registered: June 1994
Junior Member
I'm looking for a quick way to compare two arrays in IDL, A and B,
and determine which elements of B are also in A,
so if:
A=[2,1,3,5,3,8,2,5]
B=[3,4,2,8,7,8]
I would get [0,2,3,5], because 3, 2, and 8 are in A as well as B.

I can do this with loops, but that takes too long for big arrays. Does anyone
have a way to do this using array functions or perhaps an external routine?
Terry Kucera
kucera@stars.gsfc.nasa.gov
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Finding common elements in two arrays
Next Topic: Please help with buggy widget code

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

Current Time: Fri Oct 10 12:17:07 PDT 2025

Total time taken to generate the page: 1.20057 seconds