Re: Select values from one array that match multiple values from an other array [message #82471 is a reply to message #82218] |
Thu, 13 December 2012 13:51   |
Sir Loin Steak
Messages: 42 Registered: January 2012
|
Member |
|
|
On Thursday, December 13, 2012 7:51:56 PM UTC, lj...@fsmail.net wrote:
> On Thursday, December 13, 2012 6:45:01 PM UTC, David Fanning wrote:
>
>> David Fanning writes:
>
>>
>
>>
>
>>
>
>>> Do you want a POSITIONS keyword for the SetDifference function?
>
>>
>
>>> If so, I think I'll leave that as an exercise for the reader.
>
>>
>
>>> No reason why I should be the only one working around here! :-)
>
>>
>
>>
>
>>
>
>> Oh, sorry. I see you *did* say SetDifference. I read it
>
>>
>
>> as SetIntersection. Duh!
>
>>
>
>>
>
>>
>
>> Well, I'll still leave it as an exercise for the reader,
>
>>
>
>> since I've already demonstrated how it can be done. It
>
>>
>
>> will probably take less than a minute. Send it to me
>
>>
>
>> when you are finished modifying it, and I'll publish
>
>>
>
>> it for you. :-)
>
>>
>
>>
>
>>
>
>> Cheers,
>
>>
>
>>
>
>>
>
>> David
>
>>
>
>>
>
>>
>
>>
>
>>
>
>> --
>
>>
>
>> David Fanning, Ph.D.
>
>>
>
>> Fanning Software Consulting, Inc.
>
>>
>
>> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
>
>>
>
>> Sepore ma de ni thue. ("Perhaps thou speakest truth.")
>
>
>
>
>
> Ha - fair enough! I'll have a look over it and see what needs doing. :)
Right - I think I've got it sorted. I've added position and count keywords. I spent ages on the indices stuff, then realised I didn't need them as I only wanted to know the elements in one array. Not to worry though - I've always steered clear of the histogram function as it looks horrible, but looking through the routine made me understand it a lot better. So, it wasn't time wasted!
Anyhow, in case anyone wants a quick check the link to the file is below. I'm bound to have done something wrong!
http://www.physics.open.ac.uk/~lsteele/setdifference.pro
Cheers,
Liam Steele
|
|
|