title: save data from all loop iterations in matlab
body: <p>the following is part of my code, when I run it, I find that data and data1 is only file B5.m, I would like to save all iterations (Example, B11.m to B55.m). finally, I want to add B11 from first folder with B11 from other folder and save it in new folder.</p>
  
  <pre><code>for i = 1:5
      for j=1:5
      name=['B',num2str(i),num2str(i),'.m'];  
      name1=['B',num2str(j),num2str(i),'.m']; 
      data=load([p,name]);
      data1=load([w,name1]);
      end
  end
  </code></pre>