필터 지우기
필터 지우기

How to read a string data from excel sheet ? Or to read a single row having charaters

조회 수: 151 (최근 30일)
I want to read an excel sheet . 1st row all variable names 2: N th row all data
I just want to read the 1st row . Is that possible I have used "dataimport" function , but reads that entire excel sheet ! Is there a way to just read a single row from excel sheet ?

채택된 답변

Geoff Hayes
Geoff Hayes 2014년 7월 10일
Consider using xlsread. See xlsread for details and pay particular attention to the use of the xlRange input to this function. If you know the number of columns in the file then you could do something like
[~,txtData] = xlsread('cycling.xlsx','A1:H1')
In the above, we ignore (using ~) the first output parameter which corresponds to numeric data, and instead concentrate on the text data which is returned as a cell array of strings. We use the range 'A1:H1' to return the data in the first row for columns A through H.
Try the above and see what happens!
  댓글 수: 3

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Import from MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by