MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: question about evaluation and Manipulate



Hi Yaroslav ,

the variable a in the function definition is a global variable, but 

inside Manipulate a is a local variable. Therefore, these two a are 

different variables. What you can do is to define a as an argument:

f[x_,a_]=a x;

Manipulate[Plot[f[x,a],{x,0,1}],{a,0,1}]

hope this helps, Daniel





Yaroslav Bulatov 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?

> 

> 




  • Prev by Date: Re: delete a palette ?
  • Next by Date: Re: question about evaluation and Manipulate
  • Previous by thread: question about evaluation and Manipulate
  • Next by thread: Re: question about evaluation and Manipulate