PUT

Member Of Menu: 
List
Array
Argument Types: 
Any
Real
Complex
List
Symbol
Array
Result Type(s): 
None
List
Array
Invertible: 
No
Valid In Expression: 
No
Stack Diagram: 
List1 Real2 Item3 List4
Array1 Real2 Item3 Array4
Array1 List2 Item3 Array4
Symbol1 Real2 Item3
Symbol1 List2 Item3

This operation is used to replace an item in a list, vector or matrix at a particular index. It can either modify an item on the stack or a value stored in memory, referenced by a symbol name. If provided a list on the stack, the real number is used as an index into the list to find the item to replace and the new item to put at that location is found at the top of the stack. The index for a matrix can also be a list with a single real number. The modified list is pushed onto the stack.

Similarly, the operation can modify a vector. The index for a vector can be a real number or a list with a single real number. The item to put in the vector must be a real or complex value. If the item to put in the vector is complex, the vector itself must be complex.

Finally, the operation can modify a matrix. The index for a matrix must be a list with two real values representing the row number of column number of the item. The item to put in the matrix must be a real or complex value. If the item to put in the matrix is complex, the matrix itself must be complex.

If provided a symbol, the value of that symbol is retrieved which should be a list, vector or matrix. The item at that index is replaced with the new item and then stored as the value of that symbol. In that case, nothing is returned by the operation.