I have an excel-file which consists of about roughly 10,000 rows and has a size of around 800KB

When I try to import the data to MATLAB both with GUI import tool, or using XLSREAD I get the following message:

Could not open the spreadsheet. MATLAB reported the following error:
XLSREAD unable to read sheet "Sheet1"
File contains unexpected record length. Try saving as Excel 98

I tried saving as excel 98, but didn't help?...funny thing is, I can import other excel-files which are bigger than 10,000 rows and 800KB in size?!...

Ideas? =) My excel-file shouldn't consist anything special, just columns of numeric data with headers consisting of text...


It seems this only comes when I use MATLAB in Ubuntu 12.10...When I tried it in Windows XP it works just fine....??


XLSREAD in UBUNTU just doesn't seem to like big excel files...If I reduce the number of rows...voila...=(


The limit value of rows seems to be 746 rows. If I have 746 rows in file, reading is okay, if I have > 746, no game...

  • Does this occur for every similar excel file or just 1 specific case? Furthermore, if the sheet just contains data, it may help to copy and paste values into a new excel file. – Dennis Jaheruddin Dec 21 '12 at 10:38
  • Yes I tried similar files and it does the same thing...If I delete a lot of rows (Like from 8000 to 300) from my file Matlab can read it...but this is unacceptable =) – jjepsuomi Dec 21 '12 at 10:42
  • use R :) no that's a joke... do you know what unexpected record length means? – don.joey Dec 21 '12 at 10:42
  • Okay I will try copy and paste right away. Thank you! – jjepsuomi Dec 21 '12 at 10:42
  • Hah =D No unfortunately...I'm new with Matlab =) – jjepsuomi Dec 21 '12 at 10:43

For completeness:

As mentioned above Ubuntu does not appear to enable XLSREAD with big files.

The solution would then be to cut your file into smaller pieces (start with half, then half of half etc) untill you can use XLSREAD and afterwards combine the results.

An untested solution that may also work: Try saving it as csv and import it like that or use low level fileread commands.

protected by Community Jun 16 '13 at 21:21

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.