필터 지우기
필터 지우기

reading excel files with texts in matlab

조회 수: 12 (최근 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 CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by