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

MathGroup Archive 1997

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

Search the Archive

Re: Joining matrices

  • To: mathgroup at smc.vnet.net
  • Subject: [mg5748] Re: [mg5738] Joining matrices
  • From: Allan Hayes <hay at haystack.demon.co.uk>
  • Date: Tue, 14 Jan 1997 10:42:27 -0500
  • Sender: owner-wri-mathgroup at wolfram.com

Jean-Francois Alcover <70763.411 at compuserve.com>
[mg5738] Joining matrices
writes

>i have to join 2 or more matrices line by line
>for example : joinmat[{{{1,2},{3,4}},{{10,20},{30,40}}}]
>                 --> {{1,2,10,20},{3,4,30,40}}
>
>i have tried Transpose [Flatten[Transpose /@ ListOfMatrices,1]]
>but it seems rather slow
>can anyone help me with a faster solution ?

Jean-Francois,

lm ={{{1,2},{3,4}},{{10,20},{30,40}}};

MapThread[Join, lm]

	{{1, 2, 10, 20}, {3, 4, 30, 40}}
	
This seems to be 3 to 4 times as fast.

Allan Hayes,
hay at haystack.demon.co.uk
http://www.haystack.demon.co.uk


  • Prev by Date: Re: Error in HypergeometricPFQ-package?
  • Next by Date: Re: Image Processing: Mathematica?
  • Previous by thread: Joining matrices
  • Next by thread: Re: Joining matrices