title: Saving different sized vectors from a nested for loop in MATLAB
body: <p>I have a 3 nested for loop that produces a vector, but each time it runs through the loops the vector that is produced changes size. I need to save each of these vectors at the ended of the for loops, so I was thinking of using mat2cell and store them in a cell. But I don't know the code get out a cell vector that will contain each of these different sized vectors. </p>
  
  <p>I will give an example code</p>
  
  <pre><code>for ip = n_low:n_up
      for jx = x_low:x_up
          for jphi = phi_lowx:phi_upx
              lx = find_path(ip,jx,jphi,0,1);
             .
             .
             .
             A_r = volumeintegrate(integr_final_r , r , z , phi);
         end
     end
  end
  </code></pre>
  
  <p>Obviously, you don't know what these variables are or the numbers but I think its not needed to solve the problem. Anyways A_r is what is spit out at the end of the loops, but A_r varies in size as the loop repeats itself. I need to save every A_r vector.</p>