I have a vector variable of size nx1 I want to construct a square nxn matrix from this vector. The first column of the matrix is the vector itself. The second column is the vector itself but with the first element set to zero. The ith column of the matrix is constructed from the vector by setting the first i-1 entries to zero…
So we get is a lower triangular matrix with the diagonal = to the given vector.
g = [1 2 3 4];
G = [1 0 0 0;2 2 0 0;3 3 3 0;4 4 4 4;];