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

Home » Public Forums » archive » Re: Array comparison
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: Array comparison [message #32334 is a reply to message #32330] Wed, 02 October 2002 12:04 Go to previous messageGo to previous message
Jeff Guerber is currently offline  Jeff Guerber
Messages: 41
Registered: July 2000
Member
On Wed, 2 Oct 2002, Mike Chinander wrote:

> How about:
>
> if n_elements(uniq(([a,b])(sort([a,b])))) ne n_elements([a,b]) then print,
> 'arrays have matching values'

Uhh, doesn't that claim a match if one of the arrays contains two (or
more) identical elements, even if the arrays have no elements in common?

IDL> a=[1,2,3,4,5]
IDL> b=[6,6,7]
IDL> if n_elements(uniq(([a,b])(sort([a,b])))) ne n_elements([a,b]) then
print,'match'
match
IDL>

Jeff Guerber
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Looking for more ideas on code ...
Next Topic: Re: ROI application...

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

Current Time: Fri Oct 10 23:58:03 PDT 2025

Total time taken to generate the page: 1.51909 seconds