Re: Question about Manipulate
- To: mathgroup at smc.vnet.net
- Subject: [mg122779] Re: Question about Manipulate
- From: JasonE <ebaughjason at gmail.com>
- Date: Thu, 10 Nov 2011 06:53:37 -0500 (EST)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- References: <j9domc$b5c$1@smc.vnet.net>
You did not define the function properly.
Try this:
f[a_, x_, b_] := Sin[a x + b]
You will also need to format Manipulate differently:
Manipulate[Plot[f[a, x, b], {x, 0, 6}], {a, 1, 4}, {b, 0, 10}]
Jason Ebaugh
ebaughjason at gmail.com
www.linkedin.com/in/jasonebaugh
On Nov 9, 5:37 am, "mail... at gmail.com" <mail... at gmail.com> wrote:
> I tried the following code in Mathematica 8.0
>
> Clear["Global`*"]
> f = Sin[a x + b]
> Manipulate[Plot[f, {x, 0, 4 \[Pi]}], {a, 0.5, 2}, {b, 0, 2 \[Pi]}]
>
> The Manipulate block is showed, but the Sin function is not plotted.
>
> When I replace f in the third line with its definition,
>
> Clear["Global`*"]
> Manipulate[ Plot[Sin[a x + b], {x, 0, 4 \[Pi]}], {a, 0.5, 2}, {b, 0, 2
> \[Pi]}]
>
> The Sin function is plotted.
>
> Is this a bug or a limitation in Mathematica?