Skip folders in a for loop
Mostrar comentarios más antiguos
Hi!
I have a month's folder (May) and data for the days in the subfolders as shown. I am using a for loop to read the data of the subfolders. How do I skip the dates 26, 27 and 28?
1 comentario
Kanishk Singhal
el 28 de Jun. de 2023
You can get a list of files and folders(inside May) using dir function. You can then iterate over that.
If you want to create the folder name using vector you can use,
[13:25 29:31]
Respuesta aceptada
Más respuestas (1)
Manas
el 28 de Jun. de 2023
0 votos
Hi Indrani,
I am assuming that you are using the fullfile function in matlab to get the addressess of each folder. This function returns a character Vector which has the address of the folder. You can us the If-else statements to skip the folders with date 26,27 and 28.
for more info, you can check out the documentation:
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!