How can i make xlsread read successive excel worksheets ?
2 views (last 30 days)
Show older comments
I have a problem reading data from successive excel worksheets within a loop... The size of data in successive sheets are different, when I type the size of stored matrix ... it always shows the size of data in first worksheet ... why ?
2 Comments
Jan
on 30 Jun 2018
Post your code, such that we can know, what you are actually doing. What does "when I type the size of stored matrix" mean exactly?
Accepted Answer
Image Analyst
on 30 Jun 2018
Use
fileName = 'myExample.xlsx'
[status,sheets,xlFormat] = xlsfinfo(fileName )
to get the sheet names, then use xlsread() to open them
for k = 1 : length(sheets)
data = xlsread(fileName, sheets{k});
% Now do something with data....
end
0 Comments
More Answers (0)
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!