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

Home » Public Forums » archive » Re: Comparing 2 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: Comparing 2 arrays [message #55561 is a reply to message #55559] Sat, 25 August 2007 22:25 Go to previous messageGo to previous message
teich is currently offline  teich
Messages: 33
Registered: May 2007
Member
On Aug 26, 12:47 am, David Fanning <n...@dfanning.com> wrote:
> David Fanning writes:
>> If your arrays are the same size, there is no problem using structures.
>> You could subtract the two values and call the result "equal" if
>> the difference was "sufficiently" close to zero.
>
>> IF Total( (data1.A - data2.B) LT 1e-6) EQ N_Elements(data1.A) THEN $
>> Print, 'The arrays are equal' ELSE Print, 'The arrays are unequal'
>
> Well, you probably need to check whether the absolute
> value of the difference (ABS) is sufficiently close to
> zero. But other than that, I think this should work.
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")

Thanks David for showing me the clever way of doing this!

Howard
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Is there somebody familiar with nurbs or b-Spline?
Next Topic: File Output in IDL

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

Current Time: Wed Oct 08 19:05:53 PDT 2025

Total time taken to generate the page: 0.00398 seconds