You can use a for loop to sequentially read and name audio data as variables in Matlab. Here's some sample code:
main.m460 chars7 lines
In this code, we use sprintf
to create a unique filename and a unique variable name for the audio data, based on the loop counter. We then use audioread
to read the audio file and eval
to create a variable with the unique variable name and assign the audio data to it.
Note: eval
can be potentially dangerous, so use it with caution.
gistlibby LogSnag