Changing column name for a dataset

7 vues (au cours des 30 derniers jours)
Neesha
Neesha le 22 Août 2014
Commenté : Neesha le 27 Août 2014
Hi If i have column titles as 'shop floor Q1 Q2 Q3 Q4' i want to just change floor as floorNum. how do i do that

Réponse acceptée

Neesha
Neesha le 27 Août 2014
not working.. :(
Error using dataset/subsasgnDot (line 31) Unknown dataset property: VariableNames.
Error in dataset/subsasgn (line 83) a = subsasgnDot(a,s,b);
  2 commentaires
Guillaume
Guillaume le 27 Août 2014
Right, you're not using a table but something out of the stats toolbox, which I don't have.
According to the documentation, for dataset d, it's:
d.Properties.VarNames{2} = 'floorNum';
There's even an example of changing the name right in the doc.
doc dataset
Neesha
Neesha le 27 Août 2014
ok, thanks. It worked. if i changed curly brackets to paranthesis.

Connectez-vous pour commenter.

Plus de réponses (1)

Guillaume
Guillaume le 22 Août 2014
Modifié(e) : Guillaume le 22 Août 2014
Assuming you're talking about a table (which I'll call T):
T.Properties.VariableNames{2} = 'floorNum';
For more information:
doc 'Table properties'

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Tags

Aucun tag saisi pour le moment.

Community Treasure Hunt

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

Start Hunting!

Translated by