Set• lhs = rhs evaluates rhs and assigns the result to be the value of lhs. From then on, lhs is replaced by rhs whenever it appears. • { , , ... } = { , , ... } evaluates the and assigns the results to be the values of the corresponding . • New assignments with identical lhs overwrite old ones. • You can see all the assignments associated with a symbol lhs by evaluating ?lhs or by clicking on the Calculation controller. • lhs = rhs returns rhs even if for some reason the assignment specified cannot be performed. • See also: Clear, SetDelayed.
Examples Using InstantCalculatorsHere are the InstantCalculators for the Set function. Enter the parameters for your calculation and click Define to see the result.
Out[1]= |  |
Entering Commands DirectlyYou can paste a template for this command via the Text Input button on the Set Function Controller. Set the variable a to 3.
Out[3]= |  |
The variable can be used in calculations.
Out[4]= |  |
This is understood as a new variable. It is not interpreted as multiplication of a and b.
Out[5]= |  |
To multiply a and b, insert a space.
Out[6]= |  |
Variable names can be strings of characters such as expr. Their values can be math expressions or numerical values.
Out[7]= |  |
Clear the variable definitions.
|