Sometimes, we have files that names like below :
ExampleFolder . ...filename(1).ext . ...filename(2).ext . ...filename(3).ext
And we want to read these files for making some changes and save again with a name that have an iteration number.
So, we need to a loop and an integer variable for using in filenames. For joining the numbers and the filenames, we can use “sprintf()” command.
Here’s a basic example:
for counter=1:70 filename = sprintf('folder/audio (%d).au', sayac); disp(filename); analyze_audio=miraudio(filename); end
Output of the code:
folder/audio 1.au folder/audio 2.au .. .. folder/audio 70.au