reading excel files with texts in matlab

6 ビュー (過去 30 日間)
cgo
cgo 2018 年 8 月 19 日
回答済み: Image Analyst 2018 年 8 月 19 日
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?

採用された回答

Yuvaraj Venkataswamy
Yuvaraj Venkataswamy 2018 年 8 月 19 日
if true
[X,T,c] = xlsread ('file_name');
end
Try this.

その他の回答 (1 件)

Image Analyst
Image Analyst 2018 年 8 月 19 日
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.

カテゴリ

Help Center および File ExchangeSpreadsheets についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by