# Adding linearly independent row vectors to a matrix.

Suppose we are given a matrix $M_{n*2n}$ of $n$ linearly independent row vectors. Then I am trying to find an algorithmic way to add $n$ more linearly independent row vectors to this matix resulting in to a matrix $M_{2n*2n}$.

Consider this easy example, if the given matrix $M_{2*4}$ is \begin{bmatrix}0&1&0&0\\1&0&0&0\end{bmatrix} then we can add $[0,0,0,1]$ and $[0,0,1,0]$ to obtain the matrix $M_{4*4}$ \begin{bmatrix}0&1&0&0\\1&0&0&0\\0&0&0&1 \\0&0&1&0 \end{bmatrix}

EDIT 1: Which approach I should use for a given general matrix? Can I use row reduced echelon form (rref) here?

Take some basis for $\mathbb R^{2n}$, such as the standard basis, and consider each of the basis vectors in sequence. If it is linearly independent of the rows of the matrix so far, then append it to the matrix; otherwise discard it and move on to the next basis vector.
These two facts can only be true at the same time if the extended matrix is square, so exactly $n$ of the $2n$ basis vectors will have been added.