swap_row 函数
按一基行索引交换矩阵中的两行。
语法
LinearAlgebra:-SwapRow(matrix, row1, row2)Student:-LinearAlgebra:-SwapRows(matrix, row1, row2)swap_row(matrix, row1, row2)
参数与选项
matrix | 表示矩阵的嵌套列表。 |
|---|---|
row1 | 第一个一基行索引。 |
row2 | 第二个一基行索引。 |
示例
- 交换行
Student:-LinearAlgebra:-SwapRows([[1, 2], [3, 4]], 1, 2)返回 [[3, 4], [1, 2]]。