MathGroup Archive 1998

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

Search the Archive

RE: Why doesn't this work ?



Hi Andreas,

This will work:

Clear[S2]
S2 = {Sin[x],Cos[x]}
Plot[Evaluate[S2],{x,0,Pi}]

You have to force the evaluation prior to calling Plot.  

Regards,
RF

-----Original Message-----
From:	Andreas Keese [SMTP:A.Keese@tu-bs.de] To: mathgroup@smc.vnet.net
Sent:	Monday, January 12, 1998 3:10 AM To:	mathgroup@smc.vnet.net
Subject:	[mg10381] Why doesn't this work ?

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
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}];


Bye, 
Andreas




  • Prev by Date: postscript file output problem [help]
  • Next by Date: Re: debugging MathLink executables
  • Prev by thread: Re: Why doesn't this work ?
  • Next by thread: RE: Why doesn't this work ?