MathGroup Archive 2004

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

Search the Archive

Re: Creating a symmetric matrix


On 11 Mar 2004, at 09:50, Mark Coleman wrote:

> 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
>
>
>

The most natural way must be

A+Tranpose[A]

e.g.

A = Array[KroneckerDelta[#1 < #2, True] & , {3, 3}];


{{0, 1, 1}, {0, 0, 1}, {0, 0, 0}}


A + Transpose[A]


{{0, 1, 1}, {1, 0, 1}, {1, 1, 0}}



Andrzej Kozlowski
Chiba, Japan
http://www.mimuw.edu.pl/~akoz/


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