load a folder of excel files

5 views (last 30 days)
Kamyar Mazarei
Kamyar Mazarei on 10 Jun 2021
Commented: Stephen23 on 11 Jun 2021
hi
i have 146 excel files in a folder and want to load them all
i dont want to go through import window everytime, so is there a way to load all at once?

Accepted Answer

KSSV
KSSV on 10 Jun 2021
excelFiles = dir('*.xlsx') ;
N = length(excelFiles) ;
for i = 1:N
file = excelFiles(i).name ;
T = readtable(file) ;
% do what you want
end
  2 Comments
Kamyar Mazarei
Kamyar Mazarei on 11 Jun 2021
thank you
the T gives me a table, can i turn it into a matrix?
(the excels are all numbers not letters)
Stephen23
Stephen23 on 11 Jun 2021
"the T gives me a table, can i turn it into a matrix?"

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!