How do I search for images in a user-inputted directory with user-inputted file extensions?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
I am creating a function that will let the user give a directory name and file type, and then the function will take those and search for the corrosponding files
1 comentario
Stephen23
el 5 de Sept. de 2019
Editada: Stephen23
el 5 de Sept. de 2019
Use dir:
and fullfile:
Either loop over each of the file extensions and call dir for each one, or call dir on the folder and then filter for the extensions that you want to keep (you might find fileparts useful for this).
See also:
Respuestas (1)
jibrahim
el 6 de Sept. de 2019
Take a look at imageDatastore
To point to all files with a certain extension in a folder:
imds = imageDatastore('C:\dir\imagedata','FileExtensions',{'.jpg','.tif'})
0 comentarios
Ver también
Categorías
Más información sobre File Operations 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!