title: convert cell array in matlab to list in R
body: <p>I am converting a Cell arrays into R.
  In MATLAB I use x=cell(10,n).I want and assign a matrix to each cell in a loop like:</p>
  
  <pre><code>for i in 1:10
  for j in 1:n
  x(i,j) = [i*ones(len,1), ones(len,j)]   
  </code></pre>
  
  <p>n here is like number of columns.
  How do I do this in R? 
  I tried List in R, I guess this x looks like contains 10 lists and each list has n sub-list  and each sub-list has a matrix. Is this correct?</p>
  
  <p>The pic show  the first loop generated in Matlab .n=7. The 1st row contains one numeric matrix in each cell.
  what i want to get is able to get the the 1st matrix"3x10 double" by using</p>
  
  <pre><code>x[1][1] in R
  </code></pre>
  
  <p>Refence <a href="https://stackoverflow.com/questions/14440904/how-to-calculate-the-mean-of-list-of-list-of-matrices-in-r">how to calculate the mean of list of list of matrices in r</a></p>
  
  <p><img src="https://i.stack.imgur.com/l3nD5.png" alt="This is from Matlab"></p>
  
  <p>Answer: according to the link above the code is something like:</p>
  
  <pre><code>x&lt;-NULL
  for (i in 1:10){
     test&lt;-NULL
  for (j in 1:n){
        test[[j]]&lt;-matrix
      }
  x[[i]]&lt;-test
  }
  </code></pre>