MathGroup Archive 2012

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

Search the Archive

Programmatically specifying parameters in "Manipulate" command


Hello,
Is there a way to specify the parameters for the "Manipulate" command as a string or list? I'd like to do this since I am trying to build a "framework" that makes use of the Manipulate command, and which can be used with several different types of parameters. Using one of the examples from the documentation to illustrate my point:

This works, and illustrates what I'm trying to do:
Manipulate[Plot[Sin[a x + b], {x, 0, 6}], {a, 1, 4}, {b, 0, 10}]

However, I'd like the parameters to be a variable:
This doesn't work:

parameters = "{a,1,4},{b,0,10}";
Manipulate[Plot[Sin[a x + b], {x, 0, 6}], ToExpression[parameters]]

And neither does this:

parameters = {{a, 1, 4}, {b, 0, 10}};
Manipulate[Plot[Sin[a x + b], {x, 0, 6}], parameters]

Is there a way to specify the parameters as a variable in the Manipulate command?

Thank you,

Abed



  • Prev by Date: Re: How to use FindMaximum with a parameter passed to NDSolve??
  • Next by Date: Re: How to use FindMaximum with a parameter passed to NDSolve??
  • Previous by thread: Baseball Package for Mathematica
  • Next by thread: Re: Programmatically specifying parameters in "Manipulate" command