datetime with certain number of rows

1 visualización (últimos 30 días)
AA
AA el 9 de Abr. de 2020
Comentada: Peter Perkins el 14 de Abr. de 2020
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 comentarios
Samuele Sandrini
Samuele Sandrini el 9 de Abr. de 2020
Editada: Samuele Sandrini el 9 de Abr. de 2020
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 el 14 de Abr. de 2020
If you have a (column) vector, even simpler: A(end:(end+200)) = A(end)

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Dates and Time en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by