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

40 次查看(过去 30 天)
Hello!
How to add a column with all rows have the same data (es. '31-Jan-2015') in a table?
Thanks

采纳的回答

Adam Danz
Adam Danz 2020-5-26
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 个评论

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Dates and Time 的更多信息

标签

产品


版本

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by