Importing a large dataset from Excel into Matlab
3 views (last 30 days)
Show older comments
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
0 Comments
Accepted Answer
Titus Edelhofer
on 23 Sep 2012
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 Comment
Tom
on 25 Sep 2012
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')
More Answers (1)
See Also
Categories
Find more on Spreadsheets in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!