MathGroup Archive 2004

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

Search the Archive

AW: matrix operations

  • To: mathgroup at smc.vnet.net
  • Subject: [mg46363] AW: [mg46329] matrix operations
  • From: Matthias.Bode at oppenheim.de
  • Date: Mon, 16 Feb 2004 09:00:12 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

Hello Paolo,

does this solve your problem:

<< LinearAlgebra`MatrixManipulation`

m01 = {{a, b}, {c, d}, {e, f}};
MatrixForm[m01]
m02 = TakeRows[m01, -2]
m03 = TakeRows[m01, 2]
m02 - m03
MatrixForm[%] ?

Best regards,
Matthias Bode
Sal. Oppenheim jr. & Cie. KGaA
Koenigsberger Strasse 29
D-60487 Frankfurt am Main
GERMANY
Tel.: +49(0)69 71 34 53 80
Mobile: +49(0)172 6 74 95 77
Fax: +49(0)69 71 34 95 380
E-mail: matthias.bode at oppenheim.de
Internet: http://www.oppenheim.de





-----Ursprungliche Nachricht-----
Von: paolo tarpanelli [mailto:tarpanelli at libero.it]
Gesendet: Sonntag, 15. Februar 2004 04:20
An: mathgroup at smc.vnet.net
Betreff: [mg46329] matrix operations


If I have a matrix

a={x[[1,1]],x[[1,2]],...,x[[1,n]]}
    {x[[2,1]],x[[2,2]],...,x[[2,n]]}
            .
            .
            .
    {x[[m,1]],x[[m,2]],...,x[[m,n]]}

how can I compute the difference between any element and the previous for
each column :

aa={x[[2,1]]-x[[1,1]], x[[2,2]]-x[[1,2]],...,x[[2,n]]-x[[1,n]]}
      {x[[3,1]]-x[[2,1]], x[[3,2]]-x[[2,2]],...,x[[3,n]]-x[[2,n]]}
            .
            .
            .
      {x[[m,1]]-x[[m-1,1]],x[[m,2]]-x[[m-1,2]],...,x[[m,n]]-x[[m-1,n]]}

----------------------------------------------------------------------------
--------------------------

I built this code but it does not work

r=Array[0,{m,n}]
For[j=1,j=n,j++
       r[[i,j]]=Table[a[[i+1,j]]-a[[i,j]],{i,1,m-1,1}]]

thanks

Paolo

----------------


  • Prev by Date: RE: matrix operations
  • Next by Date: Re: matrix operations
  • Previous by thread: Re: Re: Help Browser issue in 5.0.1 on Mac OS X
  • Next by thread: sharing packages between multiple installations