Reading an element from Excel files

2 次查看(过去 30 天)
I want to read a particular element from an Excel file which has for example 500 rows and 3 columns. I am interested in the element in the 200th row and second column. I have 1000 of these files in a particular folder. How do I read and extract this particular element from all the files so I could analyse and plot a graph with what's extracted instead of manually going through each of the 1000 files to get these elements? Thank you Uche

回答(1 个)

Geoff Hayes
Geoff Hayes 2014-10-27
Elijah - try using xlsread to get the 200th element of the second column. If you have a list of *.xlsx files, then as you iterate through this list, just read the single element from each file and store it in an array
x(k) = xlsread(myFilename,'B200');
myFilename is just a local variable representing the kth filename (say, 'myFileK.xlsx'). You may need to supply the worksheet name before the 'B200' string. See the xlsread documentation for details.

标签

Community Treasure Hunt

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

Start Hunting!

Translated by