How do I read in the data from 23 sheets/tabs (of excel file) and create field (within a structure) that contains each tab's data?
Show older comments
Hi all, I have an excel file with 23 sheets/tabs. I want to read the data from each sheet/tab and assign the data into separate fields (within a structure) for each sheet/tab. Is this possible? Can I do it using a loop, instead of individually? Thank you
3 Comments
Hermes Suen
on 5 Jul 2018
Does it need to be in a struct, or could you import into a table? What does the data look like? If it it is organized by columns you can consider using a Table which would be easier. If it is a table, then you can create a cell array of the numbers 1-23, and use a loop (happy to show you some example code if it is). Do you want the data from each sheet to go into a specific field in a larger Struct, or does EACH sheet have its OWN struct?
Mathew Grey
on 6 Jul 2018
Edited: per isakson
on 6 Jul 2018
Image Analyst
on 7 Jul 2018
I can't seem to find where you attached the workbook. What question or comment did you attach it to?
Accepted Answer
More Answers (1)
Mathew Grey
on 8 Jul 2018
0 votes
Categories
Find more on Structures 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!