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:= b := 3 a + 1 In:= a = 3; b Out= 10 In:= a = 30; b Out= 91 It seems SetDelayed is doing precisely what you are requesting.