Looping Excel files in one varibale

1 view (last 30 days)
Siddharth Sankhe
Siddharth Sankhe on 1 Jun 2023
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?
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));
file names are LD-1-1, LD-1-2, LD-1-3 and so on

Answers (1)

VBBV on 1 Jun 2023
LDT{i} = 
LDT{i} = 

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!