setrow(): matrix
Set a row of a matrix.
Replaces the values of row n in a matrix with a given row vector.
Replace the first row of a matrix
Replace the first row of a matrix
import { assertEquals, assertThrows } from "jsr:@std/assert"; assertEquals(setrow([2, 0, -2], [[5, 6, 5], [7, 8, -1]], 0), [ [2, 0, -2], [7, 8, -1] ]);
Replace the second row of a matrix
Replace the second row of a matrix
import { assertEquals, assertThrows } from "jsr:@std/assert"; assertEquals(setrow([9, 21, 57], [[5, 6, 5], [7, 8, -1]], 1), [ [5, 6, 5], [9, 21, 57] ]);
A new matrix with the updated row.