swap two rows in a matrix
swap two columns in a matrix
swaprow(A, r1, r2)
swapcol(A, c1, c2)
r1, r2, c1, c2
Important: The linalg package has been deprecated. Use the superseding command LinearAlgebra[Modular][Swap], instead.
- For information on migrating linalg code to the new packages, see examples/LinearAlgebraMigration.
The swaprow(A, r1, r2) function creates a new matrix in which row r1 has been swapped with row r2. Similarly, swapcol(A, c1, c2) creates a new matrix in which column c1 has been swapped with column c2.
These functions are part of the linalg package, and so can be used in the form swaprow(..) only after performing the command with(linalg) or with(linalg, swaprow). They can always be accessed in the long form linalg[swaprow](..).
Download Help Document
What kind of issue would you like to report? (Optional)