Suppose we have the $n \times n$ block matrix $$M = [M_{i,j}] = M_{1,1} \oplus \cdots \oplus M_{n,n}$$ such that each $M_{i,i}$ is also square and has exactly one eigenvalue $\lambda_i$ and $\lambda_i = \lambda_j \implies i=j$. I need to show that the only matrices which commute with $M$ are also block diagonal with the same block sizes as $M$.
My approach so far was to try and write out a general matrix $A$ in the same block form as $M$ and assume it commutes with $M$. Then compute the multiplication on the left and right and equate the blocks, with the goal of showing that all the non-diagonal blocks must be zero. I didn't make much progress with this approach.
Do you have any suggestions?