MathGroup Archive 1999

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

Search the Archive

Re: Dealing with submatrices

  • To: mathgroup at
  • Subject: [mg18157] Re: [mg18099] Dealing with submatrices
  • From: "Wolf, Hartmut" <hwolf at>
  • Date: Sat, 19 Jun 1999 23:54:25 -0400
  • Organization: debis Systemhaus
  • References: <>
  • Sender: owner-wri-mathgroup at

Hello Chris,

Chris Hall schrieb:
> 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.
Perhaps what you need is something like that:

In[1]:= f[in_]:=With[{s=Flatten[Flatten/@ Transpose[#]& /@  in,1]},
                        "incompatible dimensions at input"]

such that:

In[2]:= ma=Array[a,{3,2}];
In[3]:= mb=Array[b,{3,3}];
In[4]:= mc=Array[c,{1,4}];
In[5]:= md=Array[d,{1,1}];

In[6]:= f[{{ma,mb},{mc,md}}]
Out[6]= {{a[1,1],a[1,2],b[1,1],b[1,2],b[1,3]},

regards, hw

  • Prev by Date: Automatic numbered captions for figures (plots)
  • Next by Date: Re: Scoping and named patterns
  • Previous by thread: Dealing with submatrices
  • Next by thread: Re: Dealing with submatrices