How to import a big matrix into matlab?
4
0
Entering edit mode
9.4 years ago
roy.granit ▴ 880

I have a really big matrix I need to import into matlab (480X70,000 = 160MB) yet for some reason this seems like an impossible mission to import this file into Matlab. That is really strange since one assumes that Matlab will know to handle big matrices.

Will be happy to hear there are some suggestions.

Thanks,
Roy

matrix Matlab • 4.6k views
ADD COMMENT
0
Entering edit mode
9.4 years ago
Michele Busby ★ 2.2k

That should be no problem.

http://www.mathworks.com/matlabcentral/answers/91711-what-is-the-maximum-matrix-size-for-each-platform

What did you try and what did it say?

ADD COMMENT
0
Entering edit mode
9.4 years ago
roy.granit ▴ 880

I've tried many things - import using the matlab 'visual interface' and several commands lines, each time it tells me there isn't enough memory or some other kind of error.

e.g.

>> num=xlsread('table_bits_sorted_norm.xls')
Warning: Could not start Excel server for import, 'basic' mode will be used. Refer to HELP XLSREAD
for more information.
> In xlsread at 176
??? Error using ==> xlsread at 234
File contains unexpected record length. Try saving as Excel 98.

(I'm using a new MabBook pro with 8gb memory, and Matlab 2010a. Also tried to do this on a PC with Matlab 2013a)

ADD COMMENT
0
Entering edit mode
9.4 years ago
Adam ★ 1.0k

Try exporting from excel as a text file and then loading into MATLAB.

ADD COMMENT
0
Entering edit mode
9.4 years ago

I think you need to melt it, I.e. turn it into a long list of row id \t col id \t value entries. Then load it as sparse matrix. Btw this is a stackoverflow, not bioiformatics, question.

ADD COMMENT

Login before adding your answer.

Traffic: 1539 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6