Importing batches of data files

2 Ansichten (letzte 30 Tage)
Dan
Dan am 7 Apr. 2014
Beantwortet: dpb am 7 Apr. 2014
I have an experiment that outputs large numbers of data files where I use matlab to convert the output to a useable format. Unfortunately the naming conventions used by the equipment aren't very consistent. Is there a way to put a large number of files in a folder and have matlab open them without having to know the filename beforehand? For example if I have files X,Y,Z in a folder is there a way to open X, perform an operation on the data, then open Y and repeat for all files in the folder without knowing the file names?

Antworten (1)

dpb
dpb am 7 Apr. 2014
Sure, just iterate thru a directory listing...
d=dir(*.*); % use appropriate wildcards to filter if needs be...
for i=1:length(d)
x=open(d(i).name); % return whatever's in the file
... % do whatever here...

Kategorien

Mehr zu File Operations finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by