[next] [prev] [prev-tail] [tail] [up]

Give a matrix

1 2 3 4 5 6

How to change it so that the second column becomes the ﬁrst, and the ﬁrst becomes the second? so that the result become

2 1 4 3 6 5

Mathematica

a={{1,2}, {3,4}, {5,6}} Reverse[a,2]

Out[29]= {{2, 1}, {4, 3}, {6, 5}}

Matlab

a =[1 2; 3 4; 5 6] [a(:,2) a(:,1)]

Maple

A:=Matrix([[1,2],[3,4],[5,6]]); A:=Matrix([ A[..,2], A[..,1] ])

[[2,1], [4,3], [6,5]]

[next] [prev] [prev-tail] [front] [up]