Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2010

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

Search the Archive

Nested Manipulate and LocalizeVariables -> False

  • To: mathgroup at smc.vnet.net
  • Subject: [mg114494] Nested Manipulate and LocalizeVariables -> False
  • From: Dean Shough <dean at shough.com>
  • Date: Sun, 5 Dec 2010 21:56:10 -0500 (EST)

I have a need to nest Manipulates, but using global variables instead of 
local variables.  I tried using the example shown in the advanced 
manipulate tutorial with the addition of LocalizeVariables -> False.  
The code I tried is

Manipulate[
 With[{value = Table[c[i], {i, 1, n}],
   controls = Sequence @@ Table[{c[i], 0, 1}, {i, 1, n}]},
  Manipulate[value, controls, LocalizeVariables -> False]], {n, 1,
  10, 1}, LocalizeVariables -> False]

The output look fine but the sliders do not move.  My next attempt 
splits the two Manipulates.

Manipulate[n, {n, 1, 10, 1}, LocalizeVariables -> False]

and

With[{value = Table[c[i], {i, 1, n}],
  controls = Sequence @@ Table[{c[i], 0, 1}, {i, 1, n}]},
 Manipulate[value, controls, LocalizeVariables -> False]]

Everything looks good at first glance, the c[i] sliders move and cause 
the values to change.  But nothing propagates outside the Manipulate!

In[236]:= Table[c[i], {i, 1, n}]

Out[236]= {c[1], c[2], c[3]}

How should this be done?  And how would this be done using lists and 
parts ( c[[i]] instead of c[i] )?

----
Dean



  • Prev by Date: Re: FileName Widget
  • Next by Date: Re: [Please Help] How to get coefficient list from a
  • Previous by thread: Re: Counting number of numbers in a large list between two valus
  • Next by thread: Re: Nested Manipulate and LocalizeVariables -> False