Re: Dealing with submatrices

*To*: mathgroup at smc.vnet.net*Subject*: [mg18157] Re: [mg18099] Dealing with submatrices*From*: "Wolf, Hartmut" <hwolf at debis.com>*Date*: Sat, 19 Jun 1999 23:54:25 -0400*Organization*: debis Systemhaus*References*: <199906171626.MAA20061@smc.vnet.net.>*Sender*: owner-wri-mathgroup at wolfram.com

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]}, If[Length[Dimensions[s]]>=2,s, "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]}, {a[2,1],a[2,2],b[2,1],b[2,2],b[2,3]}, {a[3,1],a[3,2],b[3,1],b[3,2],b[3,3]}, {c[1,1],c[1,2],c[1,3],c[1,4],d[1,1]}} regards, hw

**References**:**Dealing with submatrices***From:*Chris Hall <chall@aoe.vt.edu>