Re: Functions with Variables with Indices
- To: mathgroup at smc.vnet.net
- Subject: [mg29415] Re: [mg29394] Functions with Variables with Indices
- From: Benjamin M <Benjamin.M at gmx.de>
- Date: Mon, 18 Jun 2001 03:39:13 -0400 (EDT)
- References: <NDBBJGNHKLMPLILOIPPOAEMKCHAA.djmp@earthlink.net>
- Sender: owner-wri-mathgroup at wolfram.com
Hi, Thank you for your help! I think my problem was that I used the subscript in the definition of the function (at the point >>HERE<< in the quoted text). > Subscript[f, 1][x>>HERE<<_] := Sin[x] > Plot[Subscript[f, 1][x], {x, 0, 2*Pi}]; > Plot[Subscript[f, 1][Subscript[x, 1]], > {Subscript[x, 1], 0, 2*Pi}]; > Plot[Subscript[f, 1][Subscript[x, u]], > {Subscript[x, u], 0, 2*Pi}]; However, sometimes it still has worked when I tried it several times. I don't know why. The following two statements don't work in my Mathematica: Subscript[\[Sigma], k] = 1 Subscript[k, 0] = 5 f[k_] := 1/(Sqrt[2*Pi]*Subscript[\[Sigma], k])/ E^((k - Subscript[k, 0])^2/(2*Subscript[\[Sigma], k]^2)) Plot[Evaluate[f[x]], {x, -10, 10}] f[k_, Subscript[\[Sigma], k]*_, Subscript[k, 0]*_] := 1/(Sqrt[2*Pi]*Subscript[\[Sigma], k])/ E^((k - Subscript[k, 0])^2/(2*Subscript[\[Sigma], k]^2)) Plot[Evaluate[f[k, 1, 5]], {k, -10, 10}, PlotRange -> {0, 0.8}] Clear[f, Subscript[\[Sigma], k], Subscript[k, 0]] Do you think the problem is the Subscript in the definition?