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
Re: Select values from one array that match multiple values from an other array [message #82465 is a reply to message #82218] Fri, 14 December 2012 08:02 Go to previous messageGo to previous message
Sir Loin Steak is currently offline  Sir Loin Steak
Messages: 42
Registered: January 2012
Member
Just realised that the amended function doesn't work in the case where none of the array elements match. I have remedied this by adding count and positions sections to the 'no overlap' section of the code:

; If no overlap, return no result.
IF (minb GT maxa) OR (maxb LT mina) THEN BEGIN
success = 0
count = N_Elements(set_a)
positions = indgen(count)
RETURN, noresult
ENDIF

The amended version is at http://www.physics.open.ac.uk/~lsteele/setdifference.pro. I'm not sure if this is the right way to go about solving the problem, so feel free to alter the script further if anyone has any better ideas!

Liam
[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 19:33:05 PDT 2025

Total time taken to generate the page: 0.00695 seconds