I am using Matlab R2020b to process many .mat
data files at once. Unfortunately, the hundreds of data files I received are organized in multiple folders - with each of the .mat
files that I need in a separate folder within the parent directory.
I know how to use uigetfile
to get multiple files from the same directory. I don't think uigetdir
would work for this, as I am trying to choose multiple files of a certain type from different directories - not different directories themselves.
Is there a way to select every file with a certain extension, from multiple folders within a directory using uigetfile
or uigetdir
?
You should walk through a root folder which contains all the files you want to process. The following routines should help: dir
ls
regexp
.
But there are many other ways to implement this. Do not confine yourself to MATLAB: