title: Manipulation List of Matrices in R
body: <p>I have a list of matrices, containing 100 matrices. <code>L[[i]]</code> is a square matrix of 200*200. I want to manipulate each matrix in <code>D-L[[i]]</code> format where D is a diagonal matrix with diagonal with diagonal as sum of <code>L[[i]]</code> over columns. I want something like</p>
  
  <p><code>for(i in 1:100){
   M_i = diag(as.matrix(rowSums(L[[i]]))) - as.matrix(L[[i]])
  }</code> </p>
  
  <p>So that now I can find manipulated <code>M_i</code> and further want to print each <code>M_i</code>. Thanks in advance for any help in this direction. </p>