Re: Concatenate matrices
- To: mathgroup at smc.vnet.net
- Subject: [mg51421] Re: [mg51404] Concatenate matrices
- From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
- Date: Sun, 17 Oct 2004 03:05:05 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
<< On 16 Oct 2004, at 17:20, Thomas Guignard wrote: > Hi all > > Does somebody know if there's a simple function in mathematica to > concatenate matrices? > > Example: > > / 1 2 3 \ > A = | 3 4 5 | > \ 5 6 7 / > > / 11 12 \ > B = | 13 14 | > \ 15 16 / > > I'd like to have > > / 1 2 3 11 12 \ > R = | 3 4 5 13 14 | > \ 5 6 7 15 16 / > > And so on. See what I mean? > > Thanks a lot. > T. > > -- > Thomas Guignard > Laboratory of Electromagnetics and Acoustics > Swiss Federal Institute of Technology, Lausanne > > You can use AppendRows (and AppendColumns) form the package << "LinearAlgebra`MatrixManipulation`" A = {{1, 2, 3}, {3, 4, 5}, {5, 6, 7}}; B = {{11, 12}, {13, 14}, {15, 16}}; AppendRows[A, B] {{1, 2, 3, 11, 12}, {3, 4, 5, 13, 14}, {5, 6, 7, 15, 16}} Andrzej Kozlowski Chiba, Japan http://www.akikoz.net/~andrzej/ http://www.mimuw.edu.pl/~akoz/