MathGroup Archive 2010

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

Search the Archive

Re: How to construct symmetric matrix from just a one half matrix


On 6/14/2010 11:30 PM, dragec wrote:
> please help me with simple to apply function that will construct
> symmetric matrix from given just a half matrix with diagonal.
> Eg:
>
> From:
> 1  0  0  0
> 2  3  0  0
> 4  9  5  0
> 2  2  3  4
>
> To give:
>
> 1  2  4  2
> 2  3  9  2
> 4  9  5  3
> 2  2  3  4
>

one way:

a = {{1, 0, 0, 0},
      {2, 3, 0, 0},
      {4, 9, 5, 0},
      {2, 2, 3, 4}};

Transpose[LowerTriangularize[a, -1]] + a

{{1, 2, 4, 2},
  {2, 3, 9, 2},
  {4, 9, 5, 3},
  {2, 2, 3, 4}
}


--Nasser




  • Prev by Date: Re: How to construct symmetric matrix from just a one half matrix
  • Next by Date: Re: Simplification question
  • Previous by thread: Re: How to construct symmetric matrix from just a one half matrix
  • Next by thread: Re: How to construct symmetric matrix from just a one half matrix