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

조회 수: 37 (최근 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
Adam Danz
Adam Danz 2020년 5월 26일
편집: Adam Danz 2020년 11월 3일
Glad I could help.

댓글을 달려면 로그인하십시오.

추가 답변 (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