Previous Up Next

6.50.10  Échanger deux lignes : rowSwap swaprow rowswap

rowSwap a trois arguments : une matrice A et deux entiers n1 et n2.
rowSwap renvoie la matrice obtenue en échangeant dans A les lignes n1 et n2.
On tape :

rowSwap([[1,2],[3,4]],0,1)

On obtient :

[[3,4],[1,2]]

Previous Up Next