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

MathGroup Archive 2010

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

Search the Archive

Re: Automatic update of variables

  • To: mathgroup at smc.vnet.net
  • Subject: [mg110329] Re: Automatic update of variables
  • From: telefunkenvf14 <rgorka at gmail.com>
  • Date: Sun, 13 Jun 2010 04:12:24 -0400 (EDT)
  • References: <huvk4q$rq0$1@smc.vnet.net>

On Jun 12, 4:31 am, Antonio De Ju=E1rez <adejua... at gmail.com> wrote:
> Sometimes, I would find useful a method to update variables
> automatically. For example, given the delayed rule
>
> b:=3 a+1;
>
> it would be useful to have b updated whenever a is assigned a new
> value, like a=37. Is there any method to do this in Mathematica?
>
> Thanks,
>
>    Antonio.

You could tell Mathematica to treat b as Dynamic:

Dynamic[b]

b := 3 a + 1;

Each time you change a, b now reflects the change.

a = 2

a = 3

-RG


  • Prev by Date: Re: Number to string headed by zeros
  • Next by Date: Re: corrupted notebook
  • Previous by thread: Re: Automatic update of variables
  • Next by thread: Re: Automatic update of variables