Add row numbers to side of table in MATLAB

34 vues (au cours des 30 derniers jours)
Logan Callahan
Logan Callahan le 19 Avr 2022
Commenté : Logan Callahan le 19 Avr 2022
This is my code:
T = table(Name,Team,DVOA);
T.Name = categorical(T.Name);
T.Team = categorical(T.Team)
This is the output:
I need to add row numbers to the left-hand side of the table. Please help.
The result should look like this:

Réponses (1)

Chris
Chris le 19 Avr 2022
Modifié(e) : Chris le 19 Avr 2022
rownums = 1:size(T,1);
T.Properties.RowNames = string(rownums);

Catégories

En savoir plus sur Tables dans Help Center et File Exchange

Tags

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by