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

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

[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

this solution did not work for me on R2017a, text empty and raw displays NaN for text.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!