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

Home » Public Forums » archive » Re: Little help on 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: Little help on arrays [message #38052 is a reply to message #38051] Mon, 16 February 2004 07:12 Go to previous message
mchinand is currently offline  mchinand
Messages: 66
Registered: September 1996
Member
In article <c0qli8$42a$1@pegasus.fccn.pt>,
Nuno Oliveira <nmoliveira@fc.ul.pt> wrote:
> How do I compare one array with another? I want to avoid comparing
> position per position.
>
> IDL> if [1,1] eq [1,1] then print, 'bingo!'
> % Expression must be a scalar or 1 element array in this context: <BYTE
> Array[2]>.
> % Execution halted at: $MAIN$
>

If you don't want to compare element by element, you could check to see if the max and min of
the difference of the two arrays are the same:

IDL> if max(a-b) eq min(a-b) then print, 'bingo!'

You might want to check to make sure the arrays are the same size first.

--Mike


--
Michael Chinander
m-chinander@uchicago.edu
Department of Radiology
University of Chicago
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Little help on arrays - 2nd try
Next Topic: array multiplying (for a change)

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

Current Time: Fri Oct 10 00:18:56 PDT 2025

Total time taken to generate the page: 0.00540 seconds