Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1996
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1996

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

Search the Archive

Re: list splitting

  • To: mathgroup at smc.vnet.net
  • Subject: [mg4906] Re: [mg4872] list splitting
  • From: Andrei Constantinescu <constant at athena.polytechnique.fr>
  • Date: Fri, 4 Oct 1996 00:17:42 -0400
  • Sender: owner-wri-mathgroup at wolfram.com

  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