Re: Why doesn't this work ?
- To: mathgroup@smc.vnet.net
- Subject: [mg10560] Re: [mg10381] Why doesn't this work ?
- From: seanross@worldnet.att.net
- Date: Tue, 20 Jan 1998 16:54:03 -0500
- References: <199801120910.EAA14898@smc.vnet.net.>
Andreas Keese wrote: > > Look at this: > > This works: > Clear[S1]; > S1=Sin[x]; > Plot[S1, {x, 0, 3}] > > But why doesn't it work with more than one functions ? > > Clear[S2]; > S2={Sin[x],Cos[x]}; > Plot[S2, {x, 0, Pi}] > > gives an error - Mathematica complains that S2 is not a machine-size The reason it doesn't work is due to the process by which mathematica evaluates its functions. You need to take manual control of this process by use of Hold, Evaluate, ReleaseHold etc. The following example plots your functions: Clear[S2]; S2={Hold[Sin[x]],Hold[Cos[x]]}; Plot[Evaluate[ReleaseHold[S2]], {x, 0, Pi}] Check out section 2.5.5 in the mathematica book. Hope this helps. -- Remove the _nospam_ in the return address to respond.
- References:
- Why doesn't this work ?
- From: Andreas Keese <A.Keese@tu-bs.de>
- Why doesn't this work ?