MathGroup Archive 1998

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

Search the Archive

Re: Why doesn't this work ?



On 12 Jan 1998, Andreas Keese wrote:

|But why doesn't it work with more than one functions ? |
|  Clear[S2];
|  S2={Sin[x],Cos[x]};
|  Plot[S2, {x, 0, Pi}]

Hi, Andreas!

This works:

Clear[S2]
S2={Sin[x],Cos[x]};
Plot[Evaluate[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_]:={Sin[x/dx], Cos[x/dx], Sin[2*x/dx]}; |  S3=Evaluate[S[x] /. dx
-> 2];
|  Plot[S3, {x, 0, Pi}];

This may be:

  Clear[S,dx,S3,x]
  S[x_]:={Sin[x/dx], Cos[x/dx], Sin[2*x/dx]}
  S3=S[x]/. dx -> 2
  Plot[Evaluate[S3], {x, 0, Pi}]

Your problem is in Evaluate[]. Look in the help. The example given there
will explain you why you have this problem.

Hope this helps.

--------------------------------------------------------------------------
Julian Stoev <j.h.stoev@ieee.org>       - Ph. D. Student Intelligent
Information Processing Lab. - Seoul National University, Korea




  • Prev by Date: Re: Why doesn't this work ?
  • Next by Date: Re: ``flattening" systems of equations
  • Prev by thread: Re: Why doesn't this work ?
  • Next by thread: Re: Why doesn't this work ?