Prev: Find value of unknown const that causes integral to equal some value
Next: Number to string headed by zeros
From: Bob Hanlon on 13 Jun 2010 04:12 b == Dynamic[3 a + 1] Bob Hanlon ---- "Antonio De Ju=C3=A1rez" <adejuarez(a)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.
From: Bill Rowe on 13 Jun 2010 04:13 On 6/12/10 at 5:31 AM, adejuarez(a)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.
First
|
Prev
|
Pages: 1 2 Prev: Find value of unknown const that causes integral to equal some value Next: Number to string headed by zeros |