Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1999
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1999

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

Search the Archive

Re: Dealing with submatrices

  • To: mathgroup at smc.vnet.net
  • Subject: [mg18174] Re: [mg18099] Dealing with submatrices
  • From: "Tomas Garza" <tgarza at mail.internet.com.mx>
  • Date: Sat, 19 Jun 1999 23:54:32 -0400
  • Sender: owner-wri-mathgroup at wolfram.com

Chris Hall [chall at aoe.vt.edu] 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.

Hello Chris,

First, rearrange m (in Mathematica it is good form to use lower-case for
symbols defined by the user) by transposing the indices, so that p, say, is
p= {{m11, m21, m31},{m12, m22, m32},{m13, m23, m33}}

Then
In[1]:=
Partition[Flatten[MapThread[List, Partition[Join @@ p, 9]]], 9]

will do the trick.

Hope this helps,

Tomas Garza
Mexico City



  • Prev by Date: RE: Dealing with submatrices
  • Next by Date: units in graphics
  • Previous by thread: RE: Dealing with submatrices
  • Next by thread: Re: Dealing with submatrices