As part of some work I am doing, I am looking into the basis for the null space of the following matrix $$ [\mathbf{0}^T, \mathbf{1}^T], $$ where the vector of zeros is of length n and the vector of ones is of length m. Since the matrix is already in reduced row echelon form, I multiply it by an arbirtary vector of length n+m and equate to zero to give the following: $$ x_{n+1}+\dots+x_{n+m}=0. $$ Now, $x_{n+1}$ will be my dependent variable, with $x_{n+1}, \dots,x_{n+m}$ my independent variables. This leads to a basis with a matrix $M$ of size $n \times (m-1)$, a vector of $-1$ of length $m-1$ and an identity matrix of size $m-1$. My basis has $m-1$ columns, however this was not what I was anticipating. I carried out the same calculation on Matlab (using rank command) and I was given a basis of size $(n+m) \times (n+m-1)$, which was what I was looking for.
Could anyone give me any pointers as to where I am failing to understand why i've only managed to obtain $m-1$ basis vectors, yet Matlab is able to generate $n+m-1$ of them?
You have $n+m-1$ free variables, since the matrix has rank $1$. You can choose the non-free variable as any one among the last $m$, for instance the very last one; the equation can be written $$ x_{m+n}=-x_{n+1}-\dots-x_{n+m-1} $$ so the basis is $$ \underbrace{\begin{bmatrix} 1\\0\\0\\\vdots\\0\\0\\0\\\vdots\\0\\0 \end{bmatrix}, \begin{bmatrix} 0\\1\\0\\\vdots\\0\\0\\0\\\vdots\\0\\0 \end{bmatrix}, \dots, \begin{bmatrix} 0\\0\\0\\\vdots\\1\\0\\0\\\vdots\\0\\0 \end{bmatrix}}_n, \underbrace{ \begin{bmatrix} 0\\0\\0\\\vdots\\0\\1\\0\\\vdots\\0\\-1 \end{bmatrix}, \begin{bmatrix} 0\\0\\0\\\vdots\\0\\0\\1\\\vdots\\0\\-1 \end{bmatrix}, \dots, \begin{bmatrix} 0\\0\\0\\\vdots\\0\\0\\0\\\vdots\\1\\-1 \end{bmatrix}}_{m-1} $$