Language Reference


SQRVECH Function

SQRVECH (matrix);

The SQRVECH function transforms a packed-symmetric matrix into a dense square matrix.

The elements of the argument are unpacked (columnwise) into the lower triangle of the result and reflected across the diagonal into the upper triangle. The argument matrix should be a column-stacked, packed-symmetric matrix, such as generated by the VECH function .

For example, the following statements return a symmetric matrix:

v = T(1:6);
sqr = sqrvech(v);
print sqr;

Figure 25.394: Symmetric Matrix

sqr
1 2 3
2 4 5
3 5 6



The SQRVECH function and the VECH function are inverse operations on the set of symmetric matrices. See also the SQRSYM function , which unpacks elements in row-major order.