Changing column name for a dataset

7 ビュー (過去 30 日間)
Neesha
Neesha 2014 年 8 月 22 日
コメント済み: Neesha 2014 年 8 月 27 日
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

採用された回答

Neesha
Neesha 2014 年 8 月 27 日
not working.. :(
Error using dataset/subsasgnDot (line 31) Unknown dataset property: VariableNames.
Error in dataset/subsasgn (line 83) a = subsasgnDot(a,s,b);
  2 件のコメント
Guillaume
Guillaume 2014 年 8 月 27 日
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 2014 年 8 月 27 日
ok, thanks. It worked. if i changed curly brackets to paranthesis.

サインインしてコメントする。

その他の回答 (1 件)

Guillaume
Guillaume 2014 年 8 月 22 日
編集済み: Guillaume 2014 年 8 月 22 日
Assuming you're talking about a table (which I'll call T):
T.Properties.VariableNames{2} = 'floorNum';
For more information:
doc 'Table properties'

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

タグ

タグが未入力です。

Community Treasure Hunt

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

Start Hunting!

Translated by