Re: problem with Manipulate
- To: mathgroup at smc.vnet.net
- Subject: [mg126577] Re: problem with Manipulate
- From: Peter Breitfeld <phbrf at t-online.de>
- Date: Sun, 20 May 2012 02:34:50 -0400 (EDT)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- References: <jp54ri$gq0$1@smc.vnet.net>
"Physics is Everything....Almost" wrote:
> Why does Manipulate[ Plot[Sin[x (1+ a x)], {x,0,6} ], (a,0,2} ] work....
> BUT..... the following doesn't....
> tmp = Plot[Sin[x (1+ a x)], {x,0,6} ]
> Manipulate[ tmp , (a,0,2}]
> I checked Attributes of Manipulate and saw HoldAll......but Hold what??
> thanks.....Jerry Blimbaum
>
Manipulate doesn't know, that tmp is dependend on a. So write instead:
tmp[a_] := Plot[Sin[x (1 + a x)], {x, 0, 6}]
Manipulate[tmp[a], {a, 0, 2}]
--
_________________________________________________________________
Peter Breitfeld | Bad Saulgau, Germany | http://www.pBreitfeld.de