MATLAB: Reading all the files in a folder for processing

loading multiple file on folder

I have to process 400 files within a folder and I know how to process each of them individually for the analysis part. But I don't want to choose them manually and do the processing. So I looked for matlab code and found some, but I could only find the structure of file not the data is loaded. Can someone please guide me on this? Here is my code so far.
projectdir = 'C:\Desktop\Research\EXPERIMENT\Spectra';
dinfo = dir(fullfile(projectdir));
dinfo([dinfo.isdir]) = []; %get rid of all directories including . and ..
nfiles = length(dinfo);
for j = 1 : nfiles
filename = fullfile(projectdir, dinfo(j).name);
f1 = fopen(filename, 'r');
...
fclose(f1);
end

Best Answer

Looks much like what is in the FAQ, which has code for three scenarios:
Maybe you want to check that out. What sort of guidance do you need beyond that? We don't know what "the structure of file not the data is loaded." means. Please explain that phrase.