Codimension of linear subspace.

What is the codimension of X? X is subset of space of $2\times 2$ matrices $M_{2\times 2}$. $$X=\left\{\left( \begin{array}{cc} 0 & 0 \\ 0 & x \end{array}\right)\bigg| x \in \mathbb{R}\right\}$$ I think that the codimension is two, because dimension of $M_{2\times 2}$ is four, and dimension of $X$ is two, then the codimension is $4-2$. What do you think? thank you very much

-

The dimension of $X$ is $1$, since its elements only depend on the single parameter $x$. The dimension of $M_{2x2}$ is, as you said, 4. The codimension is therefore $4 - 1 = 3$.
$\left( \begin{array}{cc} 0 & 0 \\ 0 & 1 \end{array}\right)$ is a basis of $X$. Hence the dimension of $X$ is 1. Since the dimension of $M_{2\times 2}$ is 4, the codimension of $X$ is 3.