jjepsuomi
jjepsuomi

Reputation: 4373

XLSREAD unable to read file in MATLAB R2012

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

Upvotes: 3

Views: 4812

Answers (2)

bonsaifan
bonsaifan

Reputation: 391

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.

Upvotes: 2

Shai
Shai

Reputation: 114976

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.

Upvotes: 0

Related Questions