Reading an element from Excel files
이전 댓글 표시
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
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.
카테고리
도움말 센터 및 File Exchange에서 Spreadsheets에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!