Re: question about evaluation and Manipulate
- To: mathgroup at smc.vnet.net
- Subject: [mg78448] Re: [mg78300] question about evaluation and Manipulate
- From: DrMajorBob <drmajorbob at bigfoot.com>
- Date: Mon, 2 Jul 2007 06:46:10 -0400 (EDT)
- References: <30671204.1183021014539.JavaMail.root@m35>
- Reply-to: drmajorbob at bigfoot.com
You want to vary a, so make it a variable!
f[a_, x_] = a x;
Manipulate[Plot[f[a, x], {x, 0, 1}], {a, 0, 1}]
or
Clear[f]
f[a_][x_] = a x;
Manipulate[Plot[f[a][x], {x, 0, 1}], {a, 0, 1}]
Bobby
On Thu, 28 Jun 2007 03:16:27 -0500, Yaroslav Bulatov
<yaroslavvb at gmail.com> wrote:
> I'm trying to manipulate a plot where the plotted expression is a
> symbol that should be evaluated before plotting.
>
> f[x_] = a x;
> Manipulate[Plot[f[x], {x, 0, 1}], {a, 0, 1}]
>
> This doesn't work, presumably because Plot doesn't have access to the
> value of "a" set by Manipulate. So I'd like to evaluate the first
> argument Plot, but not Plot itself before Manipulate is executed, is
> there a way to do this?
>
>
>
--
DrMajorBob at bigfoot.com