title: Fill matrixes that end in different number in a for loop
body: <p>I would like to fill several matrices in a for loop.</p>
  
  <p>My for loop looks like this:</p>
  
  <pre><code>for(i in 1:19){
  
  assign(paste("accurancy_train", i, sep="_"), matrix(nrow=5, ncol=10))
  assign(paste("accurancy_test", i, sep="_"), matrix(nrow=5, ncol=10))
  
  for(r in 1:10) {
  
   #something
  
   for(t in 1:5) {
    a &lt;- 1
  
   accurancy_train_"i"[t,r] &lt;- a #this is the problematic part
   accurancy_test_"i"[t,r] &lt;- a  #this is the problematic part
  }
  }
  }
  </code></pre>
  
  <p>My expected output in this toy example should be</p>
  
  <pre><code>&gt;accurancy_train_1
  
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
  [1,]   1   1     1    1    1    1    1    1    1    1
  [2,]   1   1     1    1    1    1    1    1    1    1
  [3,]   1   1     1    1    1    1    1    1    1    1
  [4,]   1   1     1    1    1    1    1    1    1    1
  [5,]   1   1     1    1    1    1    1    1    1    1
  
  &gt;accurancy_train_2
  
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
  [1,]   1   1     1    1    1    1    1    1    1    1
  [2,]   1   1     1    1    1    1    1    1    1    1
  [3,]   1   1     1    1    1    1    1    1    1    1
  [4,]   1   1     1    1    1    1    1    1    1    1
  [5,]   1   1     1    1    1    1    1    1    1    1
  </code></pre>
  
  <p>.
  .
  .</p>
  
  <pre><code>&gt;accurancy_train_19
  
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
  [1,]   1   1     1    1    1    1    1    1    1    1
  [2,]   1   1     1    1    1    1    1    1    1    1
  [3,]   1   1     1    1    1    1    1    1    1    1
  [4,]   1   1     1    1    1    1    1    1    1    1
  [5,]   1   1     1    1    1    1    1    1    1    1
  </code></pre>
  
  <p>I don't want to create a list, in the end, I will vectorize each table and then I want to make a cbind to have a single table. But I am not sure how to fill the tables from 1 to 19. Could someone help me with this?</p>