Read Files from Directory
Mostrar comentarios más antiguos
Hey,
I'd like to be able to give a program a directory, and then have it run a second program on all files in that directory. For example, say I have a function, myFun(filePath) that reads, processes, and displays data from the file specified by filePath. Now, I'd like to write another function, in pseudocode below:
funtion dirFun(dirPath)
f = files(dirPath);
for x = 1:length(files);
myFun(f[x]);
end
Something like this. I want a function, here "files" which will return all of the file names within the directory, so that I can run the program on all my files. Is there such a function in MATLAB?
Respuesta aceptada
Más respuestas (1)
Andrii Mazur
el 16 de Jun. de 2018
1 voto
Thank you!
Categorías
Más información sobre File Operations en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!