RE: Why doesn't this work ?
- To: mathgroup@smc.vnet.net
- Subject: [mg10429] RE: [mg10381] Why doesn't this work ?
- From: Jean-Marie THOMAS <jmthomas@cybercable.tm.fr>
- Date: Tue, 13 Jan 1998 02:07:28 -0500
Have a look at section 2.2.5 of "The Mathematica Book": non standard
evaluation.
Then use:
Plot[Evaluate@s2,{x,0,Pi}]
s[x_]:={Sin[x/dx],Cos[x/dx],Sin[2 x/dx]} s3=s[x]/.dx->2
Plot[Evaluate@s3,{x,0,Pi}]
Hope this helps,
-----------------------------------------------
Jean-Marie THOMAS
Conseil et Audit en Ingenierie de Calcul jmthomas@cybercable.tm.fr
+33 (0)3 88 32 93 64
www.cybercable.tm.fr/~jmthomas
=======================
-----Message d'origine-----
De: Andreas Keese [SMTP:A.Keese@tu-bs.de] Date: lundi 12 janvier 1998
10:10
A: mathgroup@smc.vnet.net
Objet: [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