MathGroup Archive 2006

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

Search the Archive

Re: Lists and rules


You could use Position[ ]. Here, T[[1]] is A.

In[1]:=
A=Table[Random[Integer,{1,3}],{20}]

Out[1]=
{3,2,3,3,3,1,1,2,3,1,1,2,2,2,1,1,2,3,1,2}

In[2]:=
S1=Flatten[Position[A,1]]

Out[2]=
{6,7,10,11,15,16,19}

But be careful, you may not use underscores in symbol names (like S_1)!
Use S1 instead.


  • Prev by Date: Re: NonlinearFit problem
  • Next by Date: Re: Extract any diagonal from a square matrix...
  • Previous by thread: Re: Lists and rules
  • Next by thread: Re: ViewPoint selector