duplication_matrix
linear-algebra · scripts/linear-algebra/duplication_matrix.m
DUPLICATION_MATRIX Map vech(S) to S(:) for symmetric S.
D = DUPLICATION_MATRIX(N) returns the n^2-by-n(n+1)/2 duplication
matrix satisfying D * vech(S) == S(:) for every symmetric N-by-N
matrix S.
Octave-compatible public name. MATLAB has no public
duplication_matrix; portable code builds the same index map
locally. Unmarked MATLAB-mode scripts that never call this name
are unaffected.
See also COMMUTATION_MATRIX, VECH, TRIL.