Import xlsx file in workspace (sheet has strings and numbers)?

20 views (last 30 days)
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.

Accepted Answer

Walter Roberson
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
Gabriel Zalles on 28 Jan 2018
this solution did not work for me on R2017a, text empty and raw displays NaN for text.

Sign in to comment.

More Answers (0)

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!