MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Return different values of a list


Il giorno 19/lug/04, alle 13:46, Dr. Wolfgang Hintze ha scritto:

> {a,b,c,a,c}

Wolfgang,

if you have Mathematica v. 5 the help of Reap contains a very fast  
solution, namely

UnsortedUnion[x_] := Reap[Sow[1, x], _, #1 &][[2]]

In[171]:=
UnsortedUnion[{a,b,c,a,c}]

Out[171]=
{a,b,c}


------------------------------------------------------------------------ 
--------

Adriano Pascoletti
Dipartimento di Matematica e Informatica
Universita' di Udine
Via delle scienze 206
I-33100 Udine
Italy



  • Prev by Date: Re: Return different values of a list
  • Next by Date: 7 equations and 7 unknowns (non-linear equations)
  • Previous by thread: Re: Return different values of a list
  • Next by thread: Re: Return different values of a list