Re: Question about Manipulate
- To: mathgroup at smc.vnet.net
- Subject: [mg122760] Re: Question about Manipulate
- From: DrMajorBob <btreat1 at austin.rr.com>
- Date: Thu, 10 Nov 2011 06:50:12 -0500 (EST)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- References: <201111091124.GAA11113@smc.vnet.net>
- Reply-to: drmajorbob at yahoo.com
Due to variable "scope", the a and b mentioned outside Manipulate is not
the same as the a and b mentioned INSIDE Manipulate. They don't even have
the same names, even though they appear to.
Bobby
On Wed, 09 Nov 2011 05:24:44 -0600, mailcwc at gmail.com <mailcwc 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?
>
--
DrMajorBob at yahoo.com
- References:
- Question about Manipulate
- From: "mailcwc@gmail.com" <mailcwc@gmail.com>
- Question about Manipulate