Reading several Excel files
조회 수: 2 (최근 30일)
이전 댓글 표시
Hi,
I'm only the beginner in MATLAB and have a problem with reading of Excel files. There are 10 files that have only a little bit different names: '162rpm.xlsx', '324rpm.xlsx',...,'1620rpm.xlsx'. So I used this kind of code:
max_nummer=1620
k=1
for i=162:162:max_nummer
A{k}=xlsread([num2str(i),'rpm_import.xlsx'])
k=k+1
end
Each Excel file has 2 first columns with about 1,000,000 rows and 10 columns with 100,000 rows. Each file has only one worksheet
So I need to read all data from files and there are 2 conditions:
1) it must be possible to read in the column not all, but each e.g. 100th row; 2)how can I choose the range e.g. 'A2:B100000' AND 'D1:E100000' at the same time with xlsread() ?
Thanks a lot in advance!
댓글 수: 0
채택된 답변
David Sanchez
2013년 5월 28일
1) It is not possible to read every 100 cells, but you can do:
r=1:100:1000;
f=xlsread('my_xls_file.xls');
f=f(r);
2) define your range as A2:E100000 and divide your array later
f = xlsread('my_xls_file.xls','A2:E100000');
댓글 수: 0
추가 답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Spreadsheets에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!