reading excel files with texts in matlab

11 vues (au cours des 30 derniers jours)
cgo
cgo le 19 Août 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?

Réponse acceptée

Yuvaraj Venkataswamy
Yuvaraj Venkataswamy le 19 Août 2018
if true
[X,T,c] = xlsread ('file_name');
end
Try this.

Plus de réponses (1)

Image Analyst
Image Analyst le 19 Août 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.

Community Treasure Hunt

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

Start Hunting!

Translated by