Reset the order of table columns

10 visualizaciones (últimos 30 días)
Zeynab Mousavikhamene
Zeynab Mousavikhamene el 15 de Nov. de 2019
Editada: Zeynab Mousavikhamene el 15 de Nov. de 2019
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?

Respuestas (2)

the cyclist
the cyclist el 15 de Nov. de 2019
% 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 el 15 de Nov. de 2019
If you're using release R2018a or later you could use the movevars function.

Categorías

Más información sobre Tables en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by