MathGroup Archive 2002

[Date Index] [Thread Index] [Author Index]

Search the Archive

RE: basic operations in matrices

  • To: mathgroup at smc.vnet.net
  • Subject: [mg34596] RE: [mg34542] basic operations in matrices
  • From: "David Park" <djmp at earthlink.net>
  • Date: Wed, 29 May 2002 02:45:14 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Christian,

Assuming you have Version 4.1...

mat1 = {{a, 1, 1, 1}, {2, b, 2, 2}, {3, 3, c, 3}, 
    {4, 4, 4, d}}; 

Exchanges rows 1 and 3:

mat1[[{3, 2, 1, 4}]]//MatrixForm

Exchanges columns 1 and 3:

mat1[[All,{3, 2, 1, 4}]]//MatrixForm

David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/ 

> From: Christian Junk [mailto:junkc at fh-trier.de]
To: mathgroup at smc.vnet.net
> 
> 
> Hi!
> 
> I'm new to Mathematica and I'm searching for an operation, that simply
> transpose two rows or columns of a matrix M.
> 
> e.g:
> 
> Operation[M,{1,3}]
> 
> 1 1 1 1             3 3 3 3
> 2 2 2 2   --->     2 2 2 2
> 3 3 3 3             1 1 1 1
> 4 4 4 4             4 4 4 4
> 
> Much thanks in advance,
> 
> Christian
> 


  • Prev by Date: RE: help with mathematica problem
  • Next by Date: RE: Define a function
  • Previous by thread: Re: basic operations in matrices
  • Next by thread: Re: basic operations in matrices