필터 지우기
필터 지우기

Importing a large dataset from Excel into Matlab

조회 수: 4 (최근 30일)
Christian F.
Christian F. 2012년 9월 23일
Hello together,
I'm trying to import large numerical matrices e.g. [6000 x 6000], which should be no problem since I am running Matlab 64bit with 8gb ram.
However, I always get errors when I try to import the data at once. Is there any way to import the data without splitting it up into smaller pieces?
Best,
Christian

채택된 답변

Titus Edelhofer
Titus Edelhofer 2012년 9월 23일
Hi Christian,
I'm not sure who is to "blame" that it does not work at once. What kind of error message do you get? Does it come from Excel (the ActiveX server that is employed when reading Excel files) or MATLAB?
What is so bad about importing in pieces, something like
X = zeros(6000, 6000);
for ii = 0:5
data = xlsread('myfile.xlsx', sprintf('A%d:ZZZ%d', ii*1000+1, ii*1000+1000));
X(ii*1000+(1:1000), :) = data;
end
Titus
  댓글 수: 1
Tom
Tom 2012년 9월 25일
If you're going to use XLSREAD multiple times on the same file, it might be worth setting up a COM server* and working that way as it will be much faster (I think XLSREAD opens and closes a server and the file each time which wastes a lot of time)
*e.g.
actxserver('Excel.Application')

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Christian F.
Christian F. 2012년 9월 25일
편집: Christian F. 2012년 9월 25일
Hi Titus,
Thanks a lot for your reply. Unfortunately, xlsread doesnt seem to like large files and often returns some memory errors.
Anyway, thanks alot for your code, I will try that.
Best,
Christian

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by