Adding a variable to a table
2 次查看(过去 30 天)
显示 更早的评论
Suppose I have a table with row names but no variable names. I want to make the first row in my table (attached) to be recognized as the variables in my table and be able to have variables as my x axe in a plot when ploting the rows as a time series.
0 个评论
采纳的回答
Nagasai Bharat
2020-11-27
Hi,
From my understanding you are trying make your first row as the variables of your table Tx. The following script would help you achieve it.
load Tx
VarNames = string(cell2mat(table2cell(Tx(1,:))));
Tx(1,:) = [];
Tx.Properties.VariableNames = VarNames;
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!