matrix-nth ( pair matrix -- elt ) (original) (raw)
Inputs
Outputs
Word description
Retrieve the element in the matrix at the zero-indexed row, column pair.
Notes
• | This word is the two-dimensional variant of nth. |
---|---|
• | This word is intended for use with "flat" (2-dimensional) matrices. |
Errors
• | bounds-error if the first element in pair is greater than the maximum row index in matrix |
---|---|
• | bounds-error if the second element in pair is greater than the maximum column index in matrix |
Examples
Get the entry at row 1, column 0.
USING: math.matrices prettyprint ; { 1 0 } { { 0 1 } { 2 3 } } matrix-nth .
2
Definition