MathGroup Archive 1996

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

Search the Archive

Re: list splitting


  Hi !

  I think you can do the job using Position 
  and MemberQ:

In[1]:= l = {{{ 1, 2, {a-> 3, b-> 4, c-> 4}, 5}, {6, 7, {a-> 8, b-> 9}}}
        }

Out[1]= {{{1, 2, {a -> 3, b -> 4, c -> 4}, 5}, {6, 7, {a -> 8, b -> 9}}}}

In[5]:= MemberQ[ l , a -> 3 , 4 ]

Out[5]= True

In[6]:=  MemberQ[ l , a -> 2 , 4 ]

Out[6]= False


In[7]:= Position[ l, a -> 3 ]    

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


 Regards,

   a + andrei


==== [MESSAGE SEPARATOR] ====


  • Prev by Date: Re: optimal control
  • Next by Date: Re: Different Plots in the Same Window?
  • Previous by thread: list splitting
  • Next by thread: Running mathematica on the net