datetime with certain number of rows

1 次查看(过去 30 天)
AA
AA 2020-4-9
I have a datetime array with 1000 rows.
I want to extend it to 1200 rows. The last 200 rows should be just a repetition of the last date.
How can I do this?
  2 个评论
Samuele Sandrini
Samuele Sandrini 2020-4-9
编辑:Samuele Sandrini 2020-4-9
We can do like this (is a little example):
A=datetime('now') %i create a variable datetime
A(2:201,1)=A(end,1)
Peter Perkins
Peter Perkins 2020-4-14
If you have a (column) vector, even simpler: A(end:(end+200)) = A(end)

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Numeric Types 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by