Dear all,

how to transform a square matrix to a diagonal matrix using commands? for example, we have A={2,1;1,3}, how can I get a matrix B={2,0;0,3}?

thanks!