MathTop

swap_column 函数

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

语法

  • LinearAlgebra:-SwapColumn(matrix, column1, column2)
  • Student:-LinearAlgebra:-SwapColumns(matrix, column1, column2)
  • swap_column(matrix, column1, column2)

参数与选项

matrix表示矩阵的嵌套列表。
column1第一个一基列索引。
column2第二个一基列索引。

示例

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