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

2 visualizzazioni (ultimi 30 giorni)
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.

Risposta accettata

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

Più risposte (0)

Categorie

Scopri di più su Matrices and Arrays in Help Center e File Exchange

Prodotti


Release

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by