How to add a sequential number in a column of tables cell?

2 visualizaciones (últimos 30 días)
BN
BN el 12 de Feb. de 2020
Comentada: BN el 12 de Feb. de 2020
Hey all, I have a 1 x 1280 cell which includes tables. In all tables, I want to add a number after the word that wrote in the first column. 1 for the first table, 2 for the second, 3 for third and so on.
For example:
In table one:
gridded_model
--------------------
GPCC_1
GPCC_1
GPCC_1
GPCC_1
..
GPCC_1
In table two:
gridded_model
--------------------
GPCC_2
GPCC_2
GPCC_2
GPCC_2
..
GPCC_2
In table three:
gridded_model
--------------------
GPCC_3
GPCC_3
GPCC_3
GPCC_3
..
GPCC_3
and so on untill the last table.
I don't want to change anything else in other columns and rows. As my cell is too large for attach here so I cut a little part of it and attached here.
Thank you all.

Respuesta aceptada

TADA
TADA el 12 de Feb. de 2020
for i = 1:numel(Test)
t = Test{i};
t.gridded_model = strcat(t.gridded_model, '_', num2str(i));
Test{i} = t;
end

Más respuestas (0)

Categorías

Más información sobre Matrices and Arrays en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by