Re: Flip Matrix [message #41993] |
Thu, 09 December 2004 05:09 |
Timm Weitkamp
Messages: 66 Registered: August 2002
|
Member |
|
|
REVERSE is what you're looking for.
In your example, if the original matrix is called "a", try
b = REVERSE(a,1).
Cheers,
Timm
-------------------------------------------------
Timm Weitkamp <http://people.web.psi.ch/weitkamp>
-------------------------------------------------
Today at 04:55 -0800, Florian Meyer wrote:
> Hi!
>
> Is there an easy way to flip a matrix, i.e. to reverse the column
> indecies??
> example:
> 1.0 2.0 3.0 4.0 5.0
> 1.1 2.1 3.1 4.1 5.1
>
> should come out as
>
> 5.0 4.0 3.0 2.0 1.0
> 5.1 4.1 3.1 2.1 1.1
>
> I'm working now with a FOR Loop and switch each sigle column. Another
> way is a multiplication with a NxN matrix with ones on the second
> diagonal and zeros elsewhere. But I have the strong feeling that there
> must be something more easy and elegant...
>
> Florian
|
|
|