reading excel files with texts in matlab
6 views (last 30 days)
Show older comments
cgo
on 19 Aug 2018
Answered: Image Analyst
on 19 Aug 2018
I have an excel file with fields that are texts that I want to read.
X = xlsread('filename') reads the numbers, but does not read the texts. How to solve this problem?
0 Comments
Accepted Answer
More Answers (1)
Image Analyst
on 19 Aug 2018
Try this:
[numbers, strings, raw] = xls(fullFileName);
strings will contain a cell array of all the strings in your workbook, with the upper left (1,1) cell containing the upper left string in your workbook, regardless of where it occurs. So if the leftmost string is in column D and the top most string is in row 5, then strings(1,1) will be the contents of Excel cell D5, regardless if there is anything actually in that particular cell or not. So you might have row 98 be the first string in Column D, and column R be the first column in row 5, but D5 will still be at strings(1,1) but it will be empty. Basically, strings is the bounding box of all the cells with strings in them regardless of the pattern of how they're placed in Excel. Hope that explains it.
0 Comments
See Also
Categories
Find more on Spreadsheets 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!