MATLAB Answers

How to read several times similarly from EXCEL?

1 view (last 30 days)
Steven on 29 Dec 2013
Commented: Steven on 29 Dec 2013
How can we read data from Excel for similar sheet names and even file names, I mean in a loop?
for example, we want to read data from sheets A1,A2,...A100 from an Excel file.
Can we do it in a loop? I couldn't!
Things like this do not work:
for i =1:100
sheet= 'A(i)'
E1 = xlsread('filename', sheet,'range')
sheet= 'Ai'
sheet= 'A% i'
How can we do so?


Sign in to comment.

Accepted Answer

Azzi Abdelmalek
Azzi Abdelmalek on 29 Dec 2013
Edited: Azzi Abdelmalek on 29 Dec 2013
for k=1:100
sheet= sprintf('A%d',k)
E{k}= xlsread('filename', sheet)

More Answers (0)


Community Treasure Hunt

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

Start Hunting!