how read files from different folders
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
pruth
el 3 de Nov. de 2015
Comentada: Image Analyst
el 7 de Jun. de 2019
i have a folder with name 'year-2010' in this folder there 12 subfolders for 12 months(jan,feb,march ...dec.) and again in each month folder i have 30 or 31 subfolders for days .... and in each day folder i have my files(HDF5 format) which i want to read and do operations... i dont want put all files in one folder and however that is not possible... ... hope u understood my question ...waiting for answer!!!
2 comentarios
vishal rawat
el 7 de Jun. de 2019
You got the solution please shear with me I have also same problem
Image Analyst
el 7 de Jun. de 2019
Solutions were shared below in the "Answers" section of this page.
Respuesta aceptada
Jan
el 3 de Nov. de 2015
You find a lot of submissions for searching in folders recursively:
You get a list of file names with paths. Now create a loop over these file names and use movefile or copyfile to write them to the wanted location. The functions fileparts and fullfile might be useful.
0 comentarios
Más respuestas (2)
Image Analyst
el 3 de Nov. de 2015
See my attached demo, which uses genpath().
Of course you could always just make up your folder names with sprintf() if they have names that are known in advance, and then use the FAQ http://matlab.wikia.com/wiki/FAQ#How_can_I_process_a_sequence_of_files.3F, but the genpath() method is better if you don't know the folder names in advance.
2 comentarios
Image Analyst
el 4 de Nov. de 2015
Sorry I saw this late, but it looks like you've accepted an answer so I assume you have this solved and this comment is not relevant anymore. Besides, I didn't understand the question anyway or how the FAQ doesn't answer it.
hajira ashiq
el 25 de Jun. de 2018
i want to read files from folder with a singe matlab file. for example, nitrogen nd chloroful is individuay calculted when i run these files. but i want to run both files at a time with single run time.when i run the main file , the nitrogn nd chlorful is automaticaly calculated
0 comentarios
Ver también
Categorías
Más información sobre Startup and Shutdown en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!