title: how to store results into a for loop of matrices applying a function at each step of the loop?
body: <p>I'm trying to apply a function to a matrix inside a for loop. The output should also be a matrix that changes at each step of the loop. The codes below explains my problem: </p>
  
  <pre><code>  I1=apply(I0, 1, func1)
    I2=apply(I1, 1, func1)
    I3=apply(I2, 1, func1)
    .
    .
    I10=apply(I9, 1, func1)
  </code></pre>
  
  <p>I0,I1,...I10 are each 4X10 matrix, func 1 is a predefined function. I've been attempting to solve this problem with a loop. I can't find much information on this. I need something like this:</p>
  
  <pre><code>   for(i in 1:10){
       I[i]=apply(I[i-1],1,func1)
     }
  </code></pre>