RE: [Outer [Times, , ] ] Question

*To*: mathgroup at smc.vnet.net*Subject*: [mg45812] RE: [mg45790] [Outer [Times, , ] ] Question*From*: "David Park" <djmp at earthlink.net>*Date*: Mon, 26 Jan 2004 01:53:15 -0500 (EST)*Sender*: owner-wri-mathgroup at wolfram.com

Mike, The problem is MatrixForm and there was just considerable discussion of the issue on MathGroup. The problem is that MatrixForm is not transparent as some of the other Forms are. So Mathematica can't add the MatrixForms. I always do it this way... (m1 = Outer [Times, x1, y1]) // MatrixForm (m2 = Outer [Times, x2, y2]) // MatrixForm (m3 = Outer [Times, x3, y3]) // MatrixForm (mm = m1 + m2 + m3) // MatrixForm The parentheses prevent MatrixForm being wrapped around m1, m2, m3 and mm. David Park djmp at earthlink.net http://home.earthlink.net/~djmp/ From: MichaelSMcCain at cs.com [mailto:MichaelSMcCain at cs.com] To: mathgroup at smc.vnet.net Hi: I want to take a Column Vector and multiply it by a Row Vector to create an "Outer" Matrix. In other words, I want to take a 5x1 Column Vector and multiply it by a 1x4 Row Vector and output a 5x4 Matrix. I then want to add several of these Matrices together and obtain a "final" Matrix. I tried the following: x1 = {1, -1, -1, 1, 1}; y1 = {1, 1, -1, -1}; x2 = {-1, 1, -1, 1, -1}; y2 = {1, -1, 1, -1}; x3 = {1, 1, -1, -1, 1}; y3 = {-1, -1, 1, 1}; m1 = MatrixForm[Outer [Times, x1, y1] ] m2 = MatrixForm[Outer [Times, x2, y2] ] m3 = MatrixForm[Outer [Times, x3, y3] ] mm = m1 + m2 + m3 MatrixForm[mm] The output that I get is incorrect and does not combine into a single Matrix. What am I doing wrong? Thanks, Mike McCain MichaelSMcCain at cs.com