How to add a sequential number in a column of tables cell?
1 view (last 30 days)
Show older comments
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.
0 Comments
Accepted Answer
TADA
on 12 Feb 2020
for i = 1:numel(Test)
t = Test{i};
t.gridded_model = strcat(t.gridded_model, '_', num2str(i));
Test{i} = t;
end
More Answers (0)
See Also
Categories
Find more on Data Type Identification in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!