Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2002
*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 2002

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

Search the Archive

AW: Question about Replace

  • To: mathgroup at smc.vnet.net
  • Subject: [mg35691] AW: [mg35670] Question about Replace
  • From: Matthias.Bode at oppenheim.de
  • Date: Fri, 26 Jul 2002 04:16:34 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Hello Heather,

there is a simple way, try:

In[80]:=
expr=x+y+z/(x+y)+e^(x+y)+w*x+y
expr/.{(x+y)->s}
%/.{s->x}

It works here; the intermediate substitution "s" was made to see it at a
glance.

Best regards,

Matthias Bode



-----Ursprüngliche Nachricht-----
Von: xzhang2 at is2.dal.ca [mailto:xzhang2 at is2.dal.ca]
Gesendet: Donnerstag, 25. Juli 2002 10:46
An: mathgroup at smc.vnet.net
Betreff: [mg35670] Question about Replace


Hello All,

I have an expression: x+y+z/(x+y)+e^(x+y)+w*x+y.... I want to replace
any (x+y) term by x no matter how the expression looks like.  I tried
"/."command. However, it does not work properly. Is there any simple way
of doing this? Thanks.  

--
Xuguang(Heather) Zhang 




  • Prev by Date: RE: Question about Replace
  • Next by Date: Re: MINLP and MILP optimization package
  • Previous by thread: Re: Input/output Problem
  • Next by thread: Re: Orientation of BarChart labels