3
votes

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...

UPDATE !

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

2
what is the lengths of the titles? could it be that you have a "runaway" string?Shai
how many sheets do you have in your excel file? do you have other sheets with plots etc.?Shai
The longest title I have is "Ktori massa" If that's what you meant =) So they are not very long. I have 3 sheets in my excel file but sheet2 and sheet3 are empty =) I will try editing the title cells and try again =) Thnxjjepsuomi
try removing the empty sheets ??Shai

2 Answers

2
votes

I know some time has passed, but I had the same problem with Ubuntu 16.04 and MATLAB R2016a . In my case it didn't worked to delete the columns.

My solution was to change the excel file from .xls to .xlsx and try it with xlsread again (of course with changed path). Please don't ask me why it works if it's saved in an Microsoft format.

0
votes

Try removing any empty columns / rows you have in your sheet, as well as explicitly delete several columns / rows after your data. Matlab seems to have a problem with "empty" columns / rows.