Vocabularymath.
matricesInputsOutputsNone
Word descriptionSet the element in the matrix at the 2D index given by
pair to
obj. This operation is destructive.
Side effectsModifies
matrixNotes• | This word is the two-dimensional variant of set-nth. |
• | This word is intended for use with "flat" (2-dimensional) matrices. |
Errors• | bounds-error if the first element of a pair in pairs is greater than the maximum row index in matrix |
• | bounds-error if the second element of a pair in pairs is greater than the maximum column index in matrix |
• | Throws an error if the sequence cannot hold elements of the given type. |
ExamplesChange the entry at row 1, column 0.
USING: math.matrices kernel prettyprint ;
{ { 0 1 } { 2 3 } } "a" { 1 0 } pick matrix-set-nth .
{ { 0 1 } { "a" 3 } }
Definition