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

55 ビュー (過去 30 日間)
Mario Diaco
Mario Diaco 2020 年 5 月 26 日
編集済み: Adam Danz 2020 年 11 月 3 日
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 件のコメント
Mario Diaco
Mario Diaco 2020 年 5 月 26 日
Thanks a lot!
Adam Danz
Adam Danz 2020 年 5 月 26 日
編集済み: Adam Danz 2020 年 11 月 3 日
Glad I could help.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDates and Time についてさらに検索

タグ

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by