Re: Automatic update of variables
- To: mathgroup at smc.vnet.net
- Subject: [mg110321] Re: Automatic update of variables
- From: Peter Pein <petsie at dordos.net>
- Date: Sun, 13 Jun 2010 04:10:57 -0400 (EDT)
- References: <huvk4q$rq0$1@smc.vnet.net>
Am Sat, 12 Jun 2010 09:31:06 +0000 (UTC) schrieb Antonio De Ju=E1rez <adejuarez at gmail.com>: > 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. > > Hi Antonio, I'm afraid I do not understand your problem: In[1]:= b:=3 a+1; In[2]:= b Out[2]= 1+3 a In[3]:= a:=123 In[4]:= b Out[4]= 370 As you see, b changes its value as a does.