MathGroup Archive 2011

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

Search the Archive

Re: Manipulate inside module

  • To: mathgroup at smc.vnet.net
  • Subject: [mg121329] Re: Manipulate inside module
  • From: "Scot T. Martin" <smartin at seas.harvard.edu>
  • Date: Sun, 11 Sep 2011 07:27:40 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <201109101130.HAA02560@smc.vnet.net>

Try:

Module[{b = a}, (Print[b]; Manipulate[b=a;b^2, {{a, 1}, 0, 5}])]

The issue is that Module[{b=a},...] only assigns b initially. You need to
 update its value later.




________________________________________
From: Charles Wells [Charles at abstractmath.org]
Sent: Saturday, September 10, 2011 07:30
To: mathgroup at smc.vnet.net
Subject: [mg121329] Manipulate inside module

I expected the following expression to show the square of the current value
 of the slider, but it shows only a^2.  There is clearly something I don't 
understand about Module.  Any insights?

Module[{b = a}, (Print[b]; Manipulate[b^2, {{a, 1}, 0, 5}])]





  • Prev by Date: Message window
  • Next by Date: Re: Manipulate inside module
  • Previous by thread: Manipulate inside module
  • Next by thread: Re: Manipulate inside module