Import xlsx file in workspace (sheet has strings and numbers)?
20 views (last 30 days)
Show older comments
Aviroop Dutt Mazumder
on 8 Feb 2012
Commented: Gabriel Zalles
on 28 Jan 2018
I want to import an excel sheet in MATLAB, which has strings on the first row & some subsequent rows as well. I have imported the sheet, but only the numbers are highlighted whereas the string row is indicating as NaN. Kindly help me with this.
0 Comments
Accepted Answer
Walter Roberson
on 8 Feb 2012
[num, txt, raw] = xlsread('YourSheet.xlsx');
then "num" will contain the fields interpreted as numbers, "txt" will contains fields interpreted as text, and "raw" will contain uninterpreted fields.
1 Comment
Gabriel Zalles
on 28 Jan 2018
this solution did not work for me on R2017a, text empty and raw displays NaN for text.
More Answers (0)
See Also
Categories
Find more on Data Import from MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!