MathGroup Archive 1999

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

Search the Archive

Newbie question about rules

  • To: mathgroup at
  • Subject: [mg21363] Newbie question about rules
  • From: dougn_NOspam at (Doug Nelson)
  • Date: Wed, 29 Dec 1999 14:15:49 -0500 (EST)
  • Sender: owner-wri-mathgroup at

Hello All,

I just received my copy of Mathematica 4.0 and I've been reading Mastering 

I'm trying to apply a rule that changes "Sin" to "Cos" in an expression.  It 
seems to work fine with normal expressions, but not with a Plot function. 

This works:
   exp2 := Abcfunc[Sin[x]]
   exp2 /. Sin -> Cos
out = Abcfunc[Cos[x]]

However, the following gives me a sine wave plot in both cases:

   exp := Plot[Sin[x], {x,0,2 Pi}]
out = < a sine wave plot >

   exp /. Sin -> Cos
out = < another sine wave plot ! >

Why don't I get a cosine plot?

Thanks in advance,

  • Prev by Date: re: ReadList Error message:"Tag Times"
  • Next by Date: Re: volatility and greek values for financial options
  • Previous by thread: re: ReadList Error message:"Tag Times"
  • Next by thread: Re: Newbie question about rules