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

Home » Public Forums » archive » 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
Select values from one array that match multiple values from an other array [message #82218] Fri, 30 November 2012 07:15 Go to previous message
PMagdon is currently offline  PMagdon
Messages: 2
Registered: November 2012
Junior Member
Dear all,
I tried to use WHERE for multiple comparisons of two arrays.

Here is a minimal example:

1.) Two arrays

A=[1,3,2,5,2,6,1,9]
B=[1,5]

2.) I need to extract all positions of A where any of the values from B occur in A. So that C should look like this:

C=[0,3,6]

So far I tested
C=WHERE(A EQ B) but this doesn't work.

Any ideas how to solve that without looping over B?
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: array manipulation (TOTAL-ing or MEDIAN-ing) in uneven bins
Next Topic: Attempt to call undefined method: 'IDLITSYMBOL::IS3D'

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

Current Time: Wed Oct 08 16:09:44 PDT 2025

Total time taken to generate the page: 0.00482 seconds