Re: Re: Matrix Expansion question to Mathgroup
- To: mathgroup at smc.vnet.net
- Subject: [mg47863] Re: [mg47842] Re: Matrix Expansion question to Mathgroup
- From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
- Date: Thu, 29 Apr 2004 03:05:12 -0400 (EDT)
- References: <c6d8m2$ji6$1@smc.vnet.net> <200404281056.GAA12261@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
On 28 Apr 2004, at 19:56, Harold Noffke wrote: > Larry: > > Your question is not trivial, because what you have is a rank-3 > tensor, and I was not able to get AppendRows and AppendColumns to work > for rank-3 tensors A and B in a simple programming example. It is > obvious that each of your matrix elements are lists, and the only > lists you want affected by AppendRows and AppendColumns are the > outermost two -- i.e., in dimensions 1 and 2. > > MathGroup ... Do we have packages available which extend AppendRows > and AppendColumns to tensors? > > Regards, > Harold > > > > It seems to me that the real problem is that he never clearly explained his problem, at least clearly enough for people to understand what he wants done. The only way to do that is to give an example. If your intrpretation of the problem is correct than there are lots of solutions, and there is no need to use AppendRows or AppendColumns, whcih ar ein any case, not Mathematica functions but a package functions, whcih makes quite a lot of diffrence actually. Anyway, let me illustrate one approach by an example. Suppose the matri of lists is: A = {{{x, y}, {u, v}}, {{m, n}, {p, q}}} and suppose the new row you wna to add is: newrow = {{x, z}, {t, s}} Thenthe following will do it: Flatten[{A, {newrow}}, 1] Andrzej Kozlowski Chiba, Japan http://www.mimuw.edu.pl/~akoz/
- References:
- Re: Matrix Expansion question to Mathgroup
- From: Harold.Noffke@wpafb.af.mil (Harold Noffke)
- Re: Matrix Expansion question to Mathgroup