Re: Why doesn't this work ?
- To: mathgroup@smc.vnet.net
- Subject: [mg10436] Re: [mg10381] Why doesn't this work ?
- From: Wouter Meeussen <eu000949@pophost.eunet.be>
- Date: Tue, 13 Jan 1998 02:07:34 -0500
Andreas, it is the Plot[ ] that needs a in-place Evaluate command: (see help file : "Plot evaluates its arguments in a nonstandard way (see SectionA.4.). You should use Evaluate to evaluate the function to be plotted if this can safely be done before specific numerical values are supplied. ") In[7]:Clear[S2]; S2¼in[x],Cos[x]}; Plot[Evaluate@S2, {x, 0, Pi}] In[12]:Clear[S,dx,S3,x];Remove[S3] S[x_]:¼in[x/dx], Cos[x/dx], Sin[2*x/dx]}; S3[x] /. dx -> 2; Plot[Evaluate@S3, {x, 0, Pi}] wouter. At 04:10 12-01-98 -0500, Andreas Keese wrote: >Look at this: > >This works: > Clear[S1]; > S1Ân[x]; > Plot[S1, {x, 0, 3}] > >But why doesn't it work with more than one functions ? > > Clear[S2]; > S2¼in[x],Cos[x]}; > Plot[S2, {x, 0, Pi}] > >gives an error - Mathematica complains that S2 is not a machine-size >number. > >BTW: I don't want S2 to be pattern cause I want to use this as follows: > > Clear[S,dx,S3,x]; > S[x_]:¼in[x/dx], Cos[x/dx], Sin[2*x/dx]}; > S3ïaluate[S[x] /. dx -> 2]; > Plot[S3, {x, 0, Pi}]; > > >Bye, >Andreas > > Dr. Wouter L. J. MEEUSSEN w.meeussen.vdmcc@vandemoortele.be eu000949@pophost.eunet.be