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
finding exclusive elements between two not-quite identical arrays [message #89740] Tue, 25 November 2014 22:51 Go to previous message
havok2063 is currently offline  havok2063
Messages: 24
Registered: December 2012
Junior Member
So I know how to find elements in one array that are not in a second, when both arrays have identical elements.

A = [0,2,3,4]
B = [0,1,2,3,4]

print, where(histogram(A, omin=om) eq 0 and histogram(B,min=om) ne 0)+om
1

Now I want to do the same thing, but with two arrays containing integers that aren't quite identical in each one. Some of the elements can be off by +- 1. So

A = [11, 19, 40]
B = [10, 20, 30, 40]

Doing the above should return element index 2 (30) in B that is not in A, but I don't know how to do this. Any ideas?

Thanks, Brian
[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 15:57:21 PDT 2025

Total time taken to generate the page: 0.00396 seconds