How to add a column with all rows have the same data in a table?

37 visualizzazioni (ultimi 30 giorni)
Hello!
How to add a column with all rows have the same data (es. '31-Jan-2015') in a table?
Thanks

Risposta accettata

Adam Danz
Adam Danz il 26 Mag 2020
Demo
% Create table
T = table([1;2;3;4],'VariableNames',{'Data'});
% Create date vector
data = datetime('now') + (1:4)';
% Add the column of dates to the table
T.Dates = data;
The column vector must have the same number of rows as the table.
  4 Commenti

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Dates and Time in Help Center e File Exchange

Tag

Prodotti


Release

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by