A diagonal matrix is a matrix with all zero on the off diagonal elements.
When multiplying a matrix with a diagonal matrix , when the diagonal element is post-multiplying the matrix. The result is the same as the matrix but with the columns weighted each by the corresponding element in the diagonal .
When multiplying a diagonal matrix with a matrix the result is the same matrix but with the rows weighted each by the corresponding element in the diagonal .