RE: Dealing with submatrices

• To: mathgroup at smc.vnet.net
• Subject: [mg18159] RE: [mg18099] Dealing with submatrices
• From: "Ersek, Ted R" <ErsekTR at navair.navy.mil>
• Date: Sat, 19 Jun 1999 23:54:26 -0400
• Sender: owner-wri-mathgroup at wolfram.com

```Christopher D. Hall  wrote:
-------------------

I want to construct a 9x9 matrix using 9 existing 3x3 matrices:
M = { {m11, m12, m13}, {m21, m22, m23}, {m31, m32, m33}}

The problem is that this creates a too-deep nested list and I can't
figure out how
to make it a 9x9.  Flatten doesn't appear to be the right tool.

------------------
Several people indicated (BlockMatrix) in the standard package
LinearAlgebra`MatrixManipulation` will do the job.

Bob Hanlon suggested Partition and Flatten.

I give a very direct approach.

Off[General::spell1];
M1={{m111,m112,m113},{m121,m122,m123},{m131,m132,m133}};
M2={{m211,m212,m213},{m221,m222,m223},{m231,m232,m233}};
M3={{m311,m312,m313},{m321,m322,m323},{m331,m332,m333}};
M4={{m411,m412,m413},{m421,m422,m423},{m431,m432,m433}};
M5={{m511,m512,m513},{m521,m522,m523},{m531,m523,m533}};
M6={{m611,m612,m613},{m621,m622,m623},{m631,m623,m633}};
M7={{m711,m712,m713},{m721,m722,m723},{m731,m723,m733}};
M8={{m811,m812,m813},{m821,m822,m823},{m831,m823,m833}};
M9={{m911,m912,m913},{m921,m922,m923},{m931,m923,m933}};

---------

Map[Flatten,{M1,M2,M3,M4,M5,M6,M7,M8,M9}]

---------

The equivalent short hand is below.

Flatten/@{M1,M2,M3,M4,M5,M6,M7,M8,M9}

---------
Regards,
Ted Ersek

```

• Prev by Date: RE: Scoping and named patterns
• Next by Date: Re: Dealing with submatrices
• Previous by thread: Re: Dealing with submatrices
• Next by thread: Re: Dealing with submatrices