MathTop

swap_row 函数

按一基行索引交换矩阵中的两行。

语法

  • LinearAlgebra:-SwapRow(matrix, row1, row2)
  • Student:-LinearAlgebra:-SwapRows(matrix, row1, row2)
  • swap_row(matrix, row1, row2)

参数与选项

matrix表示矩阵的嵌套列表。
row1第一个一基行索引。
row2第二个一基行索引。

示例

  1. 交换行Student:-LinearAlgebra:-SwapRows([[1, 2], [3, 4]], 1, 2)返回 [[3, 4], [1, 2]]。