Reset the order of table columns

9 次查看(过去 30 天)
Is it possible to change the order of columns in matlab table? Lets assume 5th column is parameter A. Can I bring it to the first column?

回答(2 个)

the cyclist
the cyclist 2019-11-15
% Make the table
x = rand(2,1);
y = rand(2,1);
tbl = table(x,y)
% Rearrange the column order
tbl = tbl(:,[2 1]);

Steven Lord
Steven Lord 2019-11-15
If you're using release R2018a or later you could use the movevars function.

类别

Help CenterFile Exchange 中查找有关 Tables 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by