MathGroup Archive 2011

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

Search the Archive

Re: what's wrong?!!

  • To: mathgroup at smc.vnet.net
  • Subject: [mg115788] Re: what's wrong?!!
  • From: olfa <olfa.mraihi at yahoo.fr>
  • Date: Fri, 21 Jan 2011 04:28:37 -0500 (EST)
  • References: <ih16b7$jiq$1@smc.vnet.net> <ih3rd0$bga$1@smc.vnet.net>

On 18 jan, 11:52, "Sjoerd C. de Vries" <sjoerd.c.devr... at gmail.com>
wrote:
> The problem lies in the level specification. In the second example you
> try to match something that is at the top level of the expression. By
> default level expressions start at 1, but here you need to start at 0.
> The first expression is And[Equal[...],Equal[...]], but in the second
> expression you have Equal[...], but Mathematica tries to match with the .  ..
> part (level 1 and deeper). The following works:
>
> In[236]:= Cases[yP == y + x - z, yP == _, {0, Infinity}]
>
> Out[236]= {yP == x + y - z}
>
> Cheers -- Sjoerd
>
> On Jan 17, 11:40 am,olfa<olfa.mra... at yahoo.fr> wrote:
>
>
>
> > Hi Mathematica community,
>
> > I try to use Case[exp,patt,Infinity]
>
> > for the first example it works:
> > Cases[iP == i + v && kaP == 3^v,  iP == _ | kaP == _,=
 I=
> nfinity]
> > the output is  {iP == i + v, kaP == 3^v}
>
> > but not for the second one!!
> >  Cases[yP == y + x - z, yP == _, Infinity]
> > the output is  {}
>
> > why?!!
>
> > Thank you.- Masquer le texte des messages pr=E9c=E9dents -
>
> - Afficher le texte des messages pr=E9c=E9dents -

still have problem with Cases for another example:

Cases[A[l1] == A[l2] && i + B[l2] == iP + B[l1], A | B, {0, Infinity}]

returns {} why?!


  • Prev by Date: Re: Style Question: The Functional Way
  • Next by Date: Re: Style Question: The Functional Way
  • Previous by thread: Re: what's wrong?!!
  • Next by thread: Re: what's wrong?!!