Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Importing data from excel

Asked by William on 10 Aug 2012

Greetings,

I have been following instructions while trying to import text data in the form of hex values into matlab. I have one column of data 192 rows deep and I have been using

alpha12_data = importdata('alpha12_data.xlsx')
alpha12_data = 
      'PK'
alpha12_data = xlsread('alpha12_data.xlsx', 'A1:A192')
alpha12_data =
       []

neither of these two commands work. Can anyone help me by explaining why? The file alpha12_data is in current directory

Thanks

0 Comments

William

Products

No products are associated with this question.

2 Answers

Answer by Oleg Komarov on 10 Aug 2012
Edited by Oleg Komarov on 10 Aug 2012
Accepted answer

It seems that R2007b wasn't still able to import .xlsx files.

I found the first reference to this type only from R2009a!

http://www.mathworks.co.uk/help/releases/R2009a/techdoc/index.html?/help/releases/R2009a/techdoc/ref/xlsread.html

The workaround

Save it as .xls with excel.

0 Comments

Oleg Komarov
Answer by Walter Roberson on 10 Aug 2012
Edited by Walter Roberson on 10 Aug 2012

.xslx files were not supported on non-Windows systems (or Windows systems that did not have Excel installed) until R2011b or so. I do not recall at the moment when support for .xlsx files was first introduced -- it is going to depend in part on your Excel version.

0 Comments

Walter Roberson

Contact us