Repeating data in a cell structure in matlab / octave
Greetings All
I have a MATLAB cell structure like this below:
original_array={
File1.wav
File2.wav
File3.wav
}
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
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.
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
Example.
rep_cells =[1,3;2,1;3,4]
%this would be used to select what cells in the orginal_array to repeat and how many times to repeat them
new_cells={
File1.wav
File1.wav
File1.wav
File2.wav
File3.wav
File3.wav
File3.wav
File3.wav
}
Any idea the best way to do this.
Thanks