next up previous contents index
Next: 9.8 echo() Up: 9 Commands Previous: 9.6 cursor()

9.7 def()

Description
define a Program Variable. In contrast to set(), def() remembers the definition (ie, the mathematical formula) of numerical Program Variables. This is especially useful for complex math expressions used in non-linear least squares fits.

Input Program Variables
None.
Keywords/Values
The keyword is taken as the name of the variable to be assigned, and the Value is taken as the mathematical expression to use for the definition.
Output Program Variables
None.

Notes
def() is the default command and so is optional. That is, simply typing a = b is equivalent to def a = b.
Examples

 
  Iff> def (b = a + 1,  c = 100 * sqrt(b) )
  Iff> def my.chik = my.chi * my.k^kweight
Note that both b and c will change if a changes, and that my.chik will automatically update when kweight changes.
See also
set()(Section 9.40), sync()(Section 9.43).



Matt Newville
2004-02-09