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 #55559 is a reply to message #55558] Sun, 26 August 2007 02:39 Go to previous messageGo to previous message
airy.jiang is currently offline  airy.jiang
Messages: 37
Registered: May 2007
Member
On 8 26 , 1 25 , te...@atmsci.msrc.sunysb.edu wrote:
> 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- -
>
> - -

I suggest use the IDL function Array_Equal,that's a direct way.
[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: Fri Oct 10 13:38:46 PDT 2025

Total time taken to generate the page: 0.08203 seconds