Suppose that you have a mxn matrix A and want to create m diagonal matrices, each of which is from rows of A and thus has the shape nxn. The resulting
mxn
nxn