Filter löschen
Filter löschen

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

151 Ansichten (letzte 30 Tage)
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 ?

Akzeptierte Antwort

Geoff Hayes
Geoff Hayes am 10 Jul. 2014
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 Kommentare

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Data Import from MATLAB finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by