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

Home » Public Forums » archive » Re: Select values from one array that match multiple values from an other array
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 values from one array that match multiple values from an other array [message #82215 is a reply to message #82214] Fri, 30 November 2012 07:57 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

> Whoops! You wanted positions. Nevermind. :-)

OK, I just added a POSITIONS keyword to SetIntersection
that will return the positions in vector A where the
values in vector B appear.

A=[1,3,2,5,2,6,1,9]
B=[1,5]
C = SetIntersection(a, b, Positions=pos)
Print, pos
0 6 3

You can find the new program here:

http://www.idlcoyote.com/programs/setintersection.pro

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: need help with idl
Next Topic: Bug in STRMID system routine

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

Current Time: Fri Oct 10 23:51:52 PDT 2025

Total time taken to generate the page: 0.08203 seconds