vec2mat function

Fills a triangular matrix from the inputed vector