Re: List manipulation
- To: mathgroup at smc.vnet.net
- Subject: [mg70193] Re: [mg70162] List manipulation
- From: Bob Hanlon <hanlonr at cox.net>
- Date: Sat, 7 Oct 2006 07:07:14 -0400 (EDT)
- Reply-to: hanlonr at cox.net
a = Array[aa, {3, 3}];
b = Array[bb, {3, 3}];
c = Array[cc, {3, 3}];
d = Array[dd, {3, 3}];
Needs["LinearAlgebra`MatrixManipulation`"];
BlockMatrix[{{a,b},{c,d}}]
{{aa[1, 1], aa[1, 2], aa[1, 3], bb[1, 1], bb[1, 2], bb[1, 3]},
{aa[2, 1], aa[2, 2], aa[2, 3], bb[2, 1], bb[2, 2], bb[2, 3]},
{aa[3, 1], aa[3, 2], aa[3, 3], bb[3, 1], bb[3, 2], bb[3, 3]},
{cc[1, 1], cc[1, 2], cc[1, 3], dd[1, 1], dd[1, 2], dd[1, 3]},
{cc[2, 1], cc[2, 2], cc[2, 3], dd[2, 1], dd[2, 2], dd[2, 3]},
{cc[3, 1], cc[3, 2], cc[3, 3], dd[3, 1], dd[3, 2], dd[3, 3]}}
%==Join[Join@@@Thread[{a,b}],Join@@@Thread[{c,d}]]
True
Bob Hanlon
---- xun <xiaoxun at gmail.com> wrote:
> Hello,
>
> I have something as following:
>
> a = Array[aa, {3, 3}];
> b = Array[bb, {3, 3}];
> c = Array[cc, {3, 3}];
> d = Array[dd, {3, 3}];
> A = {{a, b}, {c, d}} (* A consists of four blocks *)
> A // MatrixForm
>
> And I want a 6*6 matrix (a list of 6 lists) just as A looks like.
> For example, the first row should be
>
> aa[1,1],aa[1,2],aa[1,3],bb[1,1],bb[1,2],bb[1,3]
>
> etc....
>
> How to get it easily?
>
> Many thanks.
> Xun
>
>
--
Bob Hanlon
hanlonr at cox.net