For a diagonal matrix over a field, matrix multiplication gives . Hence a matrix commutes with exactly when wherever . If all diagonal entries are distinct, the centralizer of a diagonal matrix consists exactly of diagonal matrices. When entries repeat, the allowed entries form unrestricted blocks on the corresponding eigenspaces.
Write and . Because is a diagonal matrix,
Thus exactly when for every . The three eigenvalues are distinct, so every off-diagonal entry of must be zero; diagonal entries are unrestricted. Consequently the centralizer of a diagonal matrix here is
Every displayed matrix indeed commutes with , since diagonal matrices multiply entry by entry on the diagonal.