= Solution
Let $E_{rs}$ be the <matrix unit> with its only nonzero entry in row $r$, column $s$. For
$$
A=\operatorname{diag}(1,2,\ldots,n),
$$
one has
$$
AE_{rs}=rE_{rs},
\qquad
E_{rs}A=sE_{rs}.
$$
Therefore
$$
\boxed{\phi_A(E_{rs})=(r-s)E_{rs}}.
$$
The $n^2$ matrix units form an <eigenbasis>, with $E_{rs}$ having eigenvalue $r-s$. The zero eigenspace consists exactly of the diagonal matrices and has dimension $n$. The <rank-nullity theorem> now gives
$$
\boxed{\operatorname{rank}\phi_A=n^2-n}.
$$
Back to article page