Can I insert columns into imported data

2 visualizaciones (últimos 30 días)
Shireen Adenwalla
Shireen Adenwalla el 8 de Dic. de 2016
Respondida: Walter Roberson el 8 de Dic. de 2016
I am importing data from an excel file and would like to subtract sequential rows or columns (for example) Can I do this?

Respuestas (2)

Isabella Osetinsky-Tzidaki
Isabella Osetinsky-Tzidaki el 8 de Dic. de 2016
use diff function, see its help page for right formulation

Walter Roberson
Walter Roberson el 8 de Dic. de 2016
You can use {} notation using : (colon) for the row numbers and using numeric values for column numbers. You can even
diff(YourTable{:, :}, [], 2)
to find the difference between adjacent columns.
What I do not know at the moment is whether there is a nice way to rearrange columns. You can probably use
YourTable(:, [3 1 4 2])
for example to rearrange columns including header.

Categorías

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

Community Treasure Hunt

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

Start Hunting!

Translated by