MathGroup Archive 2009

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

Search the Archive

Re: Re: variable number of controls in manipulate

  • To: mathgroup at smc.vnet.net
  • Subject: [mg105555] Re: [mg105531] Re: variable number of controls in manipulate
  • From: Syd Geraghty <sydgeraghty at me.com>
  • Date: Tue, 8 Dec 2009 06:45:47 -0500 (EST)
  • References: <200912070659.BAA12913@smc.vnet.net>

Hi Bob,

A small correction to your second suggestion pasted below:

varData = {{"Emissions", {"None", "1000GtC", "3000GtC", 
     "5000GtC"}}, {"Weathering scheme", {"Globavg", "GKWM", 
     "GEM_CO2"}}, {"Ca weather feedback", {"On", 
     "Off"}}, {"Si weather feedback", {"On", "Off"}}};

Module[{n = 1}, 
 Manipulate[Evaluate[Table[v[n], {n, Length[varData]}]], 
  Evaluate[
   Sequence @@ (Inner[{{v[n++], #2[[1]], #1}, #2} &, 
      Sequence @@ Transpose[varData], List])]]]


Note I have changed:

> Length[varvalues]-->Length[varData]


to be consistent with your recommendation (which if it were used) would not define varvalues in addition to varData:

> I recommend that you enter and store the titles and values together to keep them linked


Cheers .... Syd

Syd Geraghty B.Sc, M.Sc.

sydgeraghty at mac.com

Mathematica 7.0.1.0 for Mac OS X x86 (64 - bit) (12th September 2009)
MacOS X V 10.6.1 Snow Leopard 
MacBook Pro 2.33 GHz Intel Core 2 Duo  2GB RAM



On Dec 6, 2009, at 10:59 PM, Bob Hanlon wrote:

> Although I recommend that you enter and store the titles and values together to keep them linked. For example,
> 
> varData = {
>   {"Emissions", 
>    {"None", "1000GtC", "3000GtC", "5000GtC"}}, 
>   {"Weathering scheme", 
>    {"Globavg", "GKWM", "GEM_CO2"}}, 
>   {"Ca weath feedback", 
>    {"On", "Off"}}, 
>     {"Si weath feedback", 
>    {"On", "Off"}}};
> 
> Module[{n = 1},
> Manipulate[
>  Evaluate[
>   Table[v[n], {n, Length[varvalues]}]],
>  Evaluate[
>   Sequence @@ (
>     Inner[{{v[n++], #2[[1]], #1}, #2} &,
>      Sequence @@
>       Transpose[varData], List])]]]
> 
> 
> Bob Hanlon



  • Prev by Date: Re: Rectangle and Circle
  • Next by Date: multiplication of large multivariate polynomials
  • Previous by thread: Re: variable number of controls in manipulate
  • Next by thread: Re: variable number of controls in manipulate