MATLAB: I want to xlsread in many files

xlsread

hello.
[num txt raw] = xlsread('1.xlsx')
This code just imported only 1 file.
But i want to import many files.
After imported, in this file I want to average time data.
For example,
12:00 12:01 12:02 … 01:00 – raw data
12:00 12:15 12:30 …01:00 – revised data
I want to expression like resvised data in file.

Best Answer

xlfiles = dir('*.xlsx'); % You are in the folder of xl files
Nfiles = length(xlfiles) ; % number of xl files
% loop for each file
for i = 1:Nfiles
fname = xlfiles(i).name ; % file name
data = xlsread(fname) ; % read the file
%%do what you want %%%
end