help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: matrix transformation


From: John B. Thoo
Subject: Re: matrix transformation
Date: Wed, 27 May 2009 10:33:30 -0700


On May 27, 2009, at 9:40 AM, Paul Campbell wrote:


On Wed, May 27, 2009 at 3:52 AM, Bertrand Roessli
<address@hidden> wrote:
Hello,

I would like to transform a matrix like
e.g.

 1   2   3   1   2   3   1   2   3
 4   5   6   4   5   6   4   5   6
 7   8   9   7   8   9   7   8   9

in

 1 2 3
 4 5 6
 7 8 9
 1 2 3
 4 5 6
 7 8 9
 1 2 3
 4 5 6
 7 8 9

Is there a simple way to do that?

Thanks in advance

Bertrand Roessli

Found a simpler method

A'

http://wiki.aims.ac.za/mediawiki/index.php/Octave:Vectors_and_matrices

Hi. I don't know how to accomplish Bertrand's request easily; however, I don't think A' does it.

octave-3.0.5:32> M = [1, 2, 3; 4, 5, 6; 7, 8, 9];
octave-3.0.5:33> A = [M, M, M];  % Bertrand's original
octave-3.0.5:34> B = [M; M; M];  % what Bertrand wants
octave-3.0.5:35> B - A'
ans =

   0  -2  -4
   2   0  -2
   4   2   0
   0  -2  -4
   2   0  -2
   4   2   0
   0  -2  -4
   2   0  -2
   4   2   0

octave-3.0.5:36>

---John.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]