Given an input row or column vector,
vec2diag returns a diagonal matrix with the input argument along the diagonal.
a row or column vector.
Similar to the function
diag, except that the input argument is always
treated as a vector of elements to place along the diagonal.