RE: Creating a symmetric matrix
- To: mathgroup at smc.vnet.net
- Subject: [mg46865] RE: [mg46853] Creating a symmetric matrix
- From: "tgarza01 at prodigy.net.mx" <tgarza01 at prodigy.net.mx>
- Date: Fri, 12 Mar 2004 02:02:49 -0500 (EST)
- Reply-to: tgarza01 at prodigy.net.mx
- Sender: owner-wri-mathgroup at wolfram.com
In[1]:= anyMat = {{a, b, c}, {d, e, f}, {g, h, i}}; In[2]:= symMat = Table[If[m >= j, anyMat[[m,j]], anyMat[[j,m]]], {m, 1, 3}, {j, 1, 3}] Out[2]= {{a,d,g},{d,e,h},{g,h,i}} Tomas Garza Mexico City Original Message: ----------------- From: Mark Coleman mark at markscoleman.com To: mathgroup at smc.vnet.net Subject: [mg46865] [mg46853] Creating a symmetric matrix Greetings, How can I efficiently build a symmetric matrix from an upper triangular one, i.e., extract the upper triangular elements and insert them into the lower triangle in such a way as to make the resulting square matrix symmetric? Thanks, Mark -------------------------------------------------------------------- mail2web - Check your email from the web at http://mail2web.com/ .