title: Repeating data in a cell structure in matlab / octave
body: <p>Repeating data in a cell structure in matlab / octave</p>
  
  <p>Greetings All</p>
  
  <p>I have a MATLAB cell structure like this below:</p>
  
  <pre><code>original_array={
  File1.wav
  File2.wav
  File3.wav
  }
  </code></pre>
  
  <p>And I want to repeat or adjust or duplicate the data in the cell structure.  I was thinking of using for loops for each item in the cell structure and then create another cell structure array but that just seems like overkill. Another idea that came to mind was to have </p>
  
  <p>1) an array contain what cell I wanted to repeat 
  2)and the amount of times I want a cell in a cell structure to be repeated.
  3)and create a new cell structure from the array.</p>
  
  <p><strong>The new repeated cell structure array would get data from the *original_array* (structure array) and a new cell structure array would be created based on the *rep_cells* array</strong></p>
  
  <p>Example.
  <code>rep_cells =[1,3;2,1;3,4]</code> %this would be used to select what cells in the orginal_array to repeat and how many times to repeat them</p>
  
  <pre><code>new_cells={
  File1.wav
  File1.wav
  File1.wav
  File2.wav
  File3.wav
  File3.wav
  File3.wav
  File3.wav
  }
  </code></pre>
  
  <p>Any idea the best way to do this.</p>
  
  <p>Thanks</p>