Ben Fossen
Ben Fossen

Reputation: 1351

Reading strings into Matlab from excel?

I would like to read strings into Matlab from an excel file

ID = xlsread('data.xlsx',1, 'D2:D4')

the cells in range D2:D4 have strings in them. When I try to import the strings into Matlab all I get is an empty list? what can I do to fix this?

Upvotes: 8

Views: 19314

Answers (2)

JudoWill
JudoWill

Reputation: 4811

If you're in Matlab 2010 you can also do something like this to avoid having extra values in your workspace.

[~, ~, raw] = xlsread('data.xlsx',1, 'D2:D4')

Upvotes: 9

Ben Fossen
Ben Fossen

Reputation: 1351

I need to use this [num, txt, raw] = xlsread('data.xlsx',1, 'D2:D4')

the txt will import stings into Matlab.

Upvotes: 6

Related Questions