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

2 Ansichten (letzte 30 Tage)
BN
BN am 12 Feb. 2020
Kommentiert: BN am 12 Feb. 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.

Akzeptierte Antwort

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

Weitere Antworten (0)

Kategorien

Mehr zu Matrices and Arrays finden Sie in Help Center und File Exchange

Produkte


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by