MathGroup Archive 2004

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

Search the Archive

Re: Creating a symmetric matrix

  • To: mathgroup at smc.vnet.net
  • Subject: [mg46889] Re: Creating a symmetric matrix
  • From: drbob at bigfoot.com (Bobby R. Treat)
  • Date: Fri, 12 Mar 2004 23:40:02 -0500 (EST)
  • References: <c2p9ld$dns$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

How's this?

symmetric[a_?MatrixQ] :=
  Array[a[[Min[#1, #2], Max[#1, #2]]] &, {Length@a, Length@a}]

Bobby

Mark Coleman <mark at markscoleman.com> wrote in message news:<c2p9ld$dns$1 at smc.vnet.net>...
> 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


  • Prev by Date: Re: Undiscovered Bug?
  • Next by Date: Re: Undiscovered Bug?
  • Previous by thread: Re: Creating a symmetric matrix
  • Next by thread: Re: Re: Creating a symmetric matrix