function diagonal<__Scalar> input __Scalar v[:]; output __Scalar mat[size(v, 1), size(v, 1)]; end diagonal;