Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2006
*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 2006

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

Search the Archive

Re: Flatten and BlockProcessing

  • To: mathgroup at smc.vnet.net
  • Subject: [mg65649] Re: [mg65618] Flatten and BlockProcessing
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Wed, 12 Apr 2006 05:59:57 -0400 (EDT)
  • Reply-to: hanlonr at cox.net
  • Sender: owner-wri-mathgroup at wolfram.com

M={{{{a,b},{e,f}},{{c,d},{g,h}}},{{{k,l},{o,p}},{{m,n},{q,r}}}};

Flatten[Map[Flatten,Thread/@M,{2}],1]

Partition[Flatten[Thread/@M],4]

Join@@@Flatten[Thread/@M,1]


Bob Hanlon

> 
> From: "Maarten van der Burgt" <maarten.vanderburgt at icos.be>
To: mathgroup at smc.vnet.net
> Subject: [mg65649] [mg65618] Flatten and BlockProcessing
> 
> Hallo,
> 
> I have a structure M:
> 
> M = {{{{a, b}, {e, f}}, {{c, d}, {g, h}}}, {{{k, l}, {o, p}}, {{m, n}, {q,
> r}}}}
> 
> 
> M//Dimensions
> 
> gives
> 
> {2, 2, 2, 2},
> 
> (or more general {n1, n2, m1, m2}; M is the result of the BlockProcessing
> function from the Image Processing package)
> 
> Does anyone know an elegant way of 'flattening' M to give
> 
> {{a, b, c, d}, {e, f, g, h}, {k, l, m, n}, {o, p, q, r}}
> 
> with dimensions {4, 4} (or more general {n1*m1, n2*m2})?
> 
> 
> Thanks for your help,
> 
> 
> Maarten
> 
> 


  • Prev by Date: Re: Flatten and BlockProcessing
  • Next by Date: Re: Integral problem
  • Previous by thread: Re: Flatten and BlockProcessing
  • Next by thread: ViewPoint selector