Want to iterate over subfolders within folder
Mostrar comentarios más antiguos
I have a current working director or folder in MATLAB and wrote a function in this directory. Within this directory, I have a folder that contains 10 subfolders, each of which contains two different types of files (one is .edf and one is .xlsx). My function is designed to take an edf file and the corresponding xlsx file and compute something based on these.
So, my goal is to find a way that I can loop through these 10 subfolders and call my function on the edf and xlsx files in each subfolder one by one. Is there any way I can do this? Thanks.
4 comentarios
Shri Chand
el 23 de Mzo. de 2023
Jon
el 23 de Mzo. de 2023
Please take a look at the documentation for the dir command. You will be able to do what you wanted using this comand. If it is not clear to you how to adapt this to your situation, please explain at what point you are stuck
Shri Chand
el 23 de Mzo. de 2023
Rik
el 23 de Mzo. de 2023
The point is that nothing in your question actually requires itterating through folders, only through file pairs. And dir can generate that list of files for you.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Introduction to Installation and Licensing 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!