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 #60955 is a reply to message #60954] Mon, 23 June 2008 08:32 Go to previous messageGo to previous message
Ryan. is currently offline  Ryan.
Messages: 77
Registered: March 2006
Member
maffie wrote:
> Dear all,
>
> I have 2 arrays, of unequal length, who hold a number of indices that
> are referring to a location of another array.
> Now, I would like to choose these elements which appear in both arrays
> A and B.
>
> For example:
>
> A = [0,8,16,36,49]
> B =[1,8,33,36,49]
>
> result = [8,49]
>
> Isn't there a simple function to do that? I can't find anything
> although I have tried with SORT, UNIQ and WHERE??
>
> Thank you!
> Matthias
>

You can read about Union and Intersections on David Fanning's Website
here: http://www.dfanning.com/tips/set_operations.html

Or you can do this with CM_SETOP from Craig Markwardt's library here:
http://cow.physics.wisc.edu/~craigm/idl/idl.html

I've used Craig's CM_SETOP before because it can handle performing these
operations on strings.

Hope this helps,
Ryan.
[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: Sat Oct 11 00:58:30 PDT 2025

Total time taken to generate the page: 1.11959 seconds