LDT{i} = LDT{i} =
Looping Excel files in one varibale
1 view (last 30 days)
Show older comments
So, I want to take input of few excel files, I could have hardcoded it by assigned different varibales to each excel file, but I want to iterate this process so that it can be used for larger set of files. I tired one similar code but it shows this error. Can someone help me with this?
code:
for i = 1:4
baseFileName = 'LD-1';
extension = num2str(i);
filename = strcat(baseFileName,extension,'xlsx');
LDT(i) = [xlsread('Excel Data/LD-1-1.xlsx','C2:BL14')];
LDT(i) = sum(LDT(i));
end
file names are LD-1-1, LD-1-2, LD-1-3 and so on

0 Comments
Answers (1)
See Also
Categories
Find more on Spreadsheets in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!