Page 1 of 1

Opposite column order

Unread postPosted: Thu Jun 20, 2019 3:58 pm
by Esteban
Hellow,

Is there a way in which you could change, the column order to exactly the opposite.

What I mean is, I want this:

[1,0,2,1,0]

To become this:

[0,1,2,0,1]

I will be useful if it works for both the columns and the rows of a matrix.

Regards,

Re: Opposite column order

Unread postPosted: Thu Jun 20, 2019 10:19 pm
by TomDoan
dec rect b(%rows(a),%cols(a))
ewise b(i,j)=a(%rows(a)+1-i,j)

will make B a copy of A with the rows reversed. You can do the analogous operation with the columns. (You can also do the rows and columns together).