Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #12875 > unrolled thread

Re: Programmatically specifying parameters in "Manipulate" command

Started byBob Hanlon <hanlonr357@gmail.com>
First post2012-12-19 09:55 +0000
Last post2012-12-19 09:55 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Programmatically specifying parameters in "Manipulate" command Bob Hanlon <hanlonr357@gmail.com> - 2012-12-19 09:55 +0000

#12875 — Re: Programmatically specifying parameters in "Manipulate" command

FromBob Hanlon <hanlonr357@gmail.com>
Date2012-12-19 09:55 +0000
SubjectRe: Programmatically specifying parameters in "Manipulate" command
Message-ID<kas2vb$ci7$1@smc.vnet.net>
parameters = {{a, 1, 4}, {b, 0, 10}};

Manipulate[Plot[Sin[a x + b], {x, 0, 6}],
 Evaluate[Sequence @@ parameters]]

parameters =
  Append[#, Appearance -> "Labeled"] & /@
   {{a, 1, 4}, {b, 0, 10}};

Manipulate[Plot[Sin[a x + b], {x, 0, 6}],
 Evaluate[Sequence @@ parameters]]


Bob Hanlon


On Tue, Dec 18, 2012 at 2:36 AM,  <abed.alnaif@gmail.com> wrote:
> 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 "framewo=
rk" that makes use of the Manipulate command, and which can be used with se=
veral different types of parameters. Using one of the examples from the doc=
umentation 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
>

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web