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

Home » Public Forums » archive » Re: Removing equal elements from an array
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: Removing equal elements from an array [message #49749 is a reply to message #49748] Wed, 16 August 2006 05:20 Go to previous messageGo to previous message
Julio[1] is currently offline  Julio[1]
Messages: 52
Registered: May 2005
Member
Ok guys... Excellent tips, problem solved!


Mike escreveu:

> Julio wrote:
>> Another question... please help me!!
>
>> I have an array 'A' with two columns, latitudes and longitudes, and
>> several lines. A need to make another array with the elements of A that
>> don't repeat.
>
> Take a look at the uniq function. Here's an example:
>
> IDL> a=[1,2,3,4,5,6,7,7,8,8,8]
> IDL> print, a
> 1 2 3 4 5 6 7 7
> 8 8 8
> IDL> print, a[uniq(a)]
> 1 2 3 4 5 6 7 8
>
> Using your data:
>
> IDL> A = [[20.4, 40.3, 50.2, 50.2], [30.2, 60.2, 32.4, 32.4]]
> IDL> i = uniq(A[*,0])
> IDL> B = [[(A[*,0])[i]], [(A[*,1])[i]]]
> IDL>
> IDL> print, A
> 20.4000 40.3000 50.2000 50.2000
> 30.2000 60.2000 32.4000 32.4000
> IDL> print, B
> 20.4000 40.3000 50.2000
> 30.2000 60.2000 32.4000
>
> Mike
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: File_COPY
Next Topic: SETENV

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

Current Time: Fri Oct 10 09:38:54 PDT 2025

Total time taken to generate the page: 1.36189 seconds