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

Home » Public Forums » archive » finding exclusive elements between two not-quite identical 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: finding exclusive elements between two not-quite identical arrays [message #89744 is a reply to message #89742] Wed, 26 November 2014 11:59 Go to previous messageGo to previous message
havok2063 is currently offline  havok2063
Messages: 24
Registered: December 2012
Junior Member
On Wednesday, November 26, 2014 6:37:34 AM UTC-5, Heinz Stege wrote:
> Hi Brian,
>
> here is a quick draft:
>
> A = [11, 19, 40]
> B = [10, 20, 30, 40]
> ii=value_locate(a,b) ; needs a to be sorted
> delta=1
> jj=where(b-a[ii] gt delta and a[ii+1]-b gt delta,count) ; needs the
> ; compile option strictarrsubs NOT to be set
> if count ge 1 then print,'Part II: ',b[jj]
> kk=where(a[0]-b gt delta,count) ; use min(a) if a is not sorted
> if count ge 1 then print,'Part I: ',b[kk]
>
> Good luck, Heinz


Thanks guys. The solution offered by Heinz works best for me. I was also looking for a simple non-loop solution. I like Craig's functions, but I think CMSET_OP only works on identical elements. Thanks again everyone.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: get lat/lon from modis SIN grid
Next Topic: Giving Thanks

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

Current Time: Wed Oct 08 19:42:32 PDT 2025

Total time taken to generate the page: 0.00394 seconds