vecd function

Flatten a symmetric matrix into a vector preserving Frobenius norm.