Borrar filtros
Borrar filtros

How I can i read all files in a folder

3 visualizaciones (últimos 30 días)
Alejandro Diez
Alejandro Diez el 30 de En. de 2019
Editada: Ollie A el 30 de En. de 2019
I have a folder with files named like this: "speaker1_001.wav". From 001 to 020. How can I do a for loop to audioread all the files and storing the value in variables with different names?

Respuestas (1)

Ollie A
Ollie A el 30 de En. de 2019
Editada: Ollie A el 30 de En. de 2019
You can use sprintf().
for n = 1:20
filename = sprintf('speaker1_%03d.wav', n)
end
Then within the loop input filename into your function that reads in audio.

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by