Re: Automatic update of variables
- To: mathgroup at smc.vnet.net
- Subject: [mg110335] Re: Automatic update of variables
- From: Bill Rowe <readnews at sbcglobal.net>
- Date: Sun, 13 Jun 2010 04:13:30 -0400 (EDT)
On 6/12/10 at 5:31 AM, adejuarez at gmail.com (Antonio De Ju=C3=A1rez) 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? Given: In[11]:= b := 3 a + 1 In[12]:= a = 3; b Out[12]= 10 In[13]:= a = 30; b Out[13]= 91 It seems SetDelayed is doing precisely what you are requesting.