Effacer les filtres
Effacer les filtres

How do I name the columns of my table by the names of row 1?

13 vues (au cours des 30 derniers jours)
Amy Hughes
Amy Hughes le 3 Fév 2020
Modifié(e) : Amy Hughes le 3 Fév 2020
I have inserted a table into matlab using this
pos=readtable("Pos_data.csv")
When I do this in R, the row names in row 1 become the columne names. However, in Matlab it does not do this. Please could you tell me how I name the columns based on the names in row 1 of the table ( as this is where the title of the columns are currently).
Thank-you,

Réponse acceptée

Adam Danz
Adam Danz le 3 Fév 2020
Modifié(e) : Adam Danz le 3 Fév 2020
Check out the ReadVariableNames property; set it to true.
pos=readtable("Pos_data.csv",'ReadVariableNames',true)

Plus de réponses (1)

the cyclist
the cyclist le 3 Fév 2020
Did you try reading the documentation page for readtable?
It seems that all you need to do is this:
pos=readtable("Pos_data.csv",'ReadVariableNames',true)
  1 commentaire
Amy Hughes
Amy Hughes le 3 Fév 2020
Modifié(e) : Amy Hughes le 3 Fév 2020
Thank-you, I was just reading this.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by