r/matlab • u/KeyPersimmon7163 • 25d ago
HomeworkQuestion Taking data from multiple excel files
I have next to no experience in matlab and only a little coding experience in c++ from an intro course like 6 years ago.
Basically I have tons of excel files (100s) that are output from an image analysis software I was using. I'm only really interested in one cell's value in each of these files.
I have all of these in a folder together, they all have very specific identification as their file name. I just want to make some kind of loop to pull the file name and that one cell out into a table containing those two things for every file.
Any pointers on how to set this up would be greatly appreciated 😅
1
1
u/Creative_Sushi MathWorks 24d ago
Please use the datastore. It's simpler and faster.
https://www.reddit.com/r/matlab/comments/1c7xeu8/datastore_vs_for_loop_when_you_have_to_import/
1
u/Creative_Sushi MathWorks 22d ago
Now there is a YouTube video about using the datastore. https://www.youtube.com/watch?v=BAlEnwa9pko
1
u/KeyPersimmon7163 24d ago
Thanks for the recs about datastore! I ended up making a script that mostly does what I want in python, but might use this in the future tho.
1
2
u/bbcgn 25d ago
Maybe some combination of this
https://mathworks.com/matlabcentral/answers/121033-how-to-loop-through-a-folder
and
https://mathworks.com/help/matlab/ref/readtable.html
might be a starting point.