Display HeaderLines which were omitted during loading data

Hey there,
I have 2 questions connected with HeaderLines
1) How to display HeaderLines, which were omitted during loading data?
2) There is opportunity to load data with HeaderLines?
As regards the 2nd question, I am sure that I saw such kind of solution (HeaderLines was marked by gray) but now I just cannot find it.

2 Kommentare

Sure, but how are your reading in your data currently? What is your data file format?
Elzbieta Trynkiewicz
Elzbieta Trynkiewicz am 26 Dez. 2018
Bearbeitet: Elzbieta Trynkiewicz am 26 Dez. 2018
Now I just use readtable with str.Properties.VariableNames

Melden Sie sich an, um zu kommentieren.

 Akzeptierte Antwort

Walter Roberson
Walter Roberson am 26 Dez. 2018

1 Stimme

readtable and textscan do not store the headerlines. You would need to use other code to read the header lines. The code to use would depend on how the header lines were structured .
Header lines might be shown in gray in previews in importdata .

2 Kommentare

Elzbieta Trynkiewicz
Elzbieta Trynkiewicz am 27 Dez. 2018
Bearbeitet: Elzbieta Trynkiewicz am 27 Dez. 2018
Thanks Walter Roberson for your suggestion! Indeed importdata stores HeaderLines. So, it let me allow to refer to them.
But, there is one drawback(?) or it is simply a results of that I can't find the right solution => I am a new user (I'm still learning of Matlab).
In case of readtable I just can use str.Properties.VariableNames command to name columns, which does't work with importdata.
Walter Roberson
Walter Roberson am 27 Dez. 2018
Bearbeitet: Walter Roberson am 27 Dez. 2018
You can examine the colheaders field in what is returned by importdata .

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Data Import and Analysis finden Sie in Hilfe-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