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 #60956 is a reply to message #60955] Mon, 23 June 2008 08:37 Go to previous messageGo to previous message
humanumbrella is currently offline  humanumbrella
Messages: 52
Registered: June 2008
Member
On Jun 23, 11:32 am, maffie <matthias.demuz...@geo.kuleuven.be> wrote:
> Probably the command with the WHERE statement is not working because
> this only looks for the first elements of the shortest array. If the
> equal elements or after that location, they are missed, and a -1 is
> returned, not?
>
> This would be what is happening in my case, so I need something which
> can deal with the different array lengths (of 61 and 368 for
> example)....
>
> Thank you!

the manual says it can be use for different lengths
hmm...

; Now compare two arrays of different lengths:
c = [1,2,3,4,5,5,4,3,2,1]
d = [0,2,4]
PRINT, 'c = ', c
PRINT, 'd = ', d

result=WHERE(c EQ d)
PRINT, 'Subscripts of c that equal d: ', result

good luck,
--Justin
[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 04:27:57 PDT 2025

Total time taken to generate the page: 1.52235 seconds