MathGroup Archive 2008

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

Search the Archive

Re: Identical elements

  • To: mathgroup at
  • Subject: [mg88412] Re: Identical elements
  • From: "jwmerrill at" <jwmerrill at>
  • Date: Mon, 5 May 2008 06:10:07 -0400 (EDT)
  • References: <fvhe2h$3th$>

On May 3, 6:16 am, KFUPM <hussain.alqaht... at> wrote:
> Dear All
> I have a list  and i need to test whether all the elements in the list
> are identical or no. What is the efficient way to do that? The output
> should be true if all elements are the same and False otherwise. One
> line command is preferred if possible.
> Your help is highly appreciated.
> Regards,

There's probably a dozen ways to do this.  In version six, there's

In[448]:= MatchQ[{q, q, q, q}, PatternSequence[_]]

Out[448]= True



  • Prev by Date: Re: can't translate 3D model to 0,0,0
  • Next by Date: 32-bit front-end on 64-bit machine
  • Previous by thread: Re: Identical elements
  • Next by thread: Re: Identical elements