datetime with certain number of rows

조회 수: 2 (최근 30일)
AA
AA 2020년 4월 9일
댓글: Peter Perkins 2020년 4월 14일
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에서 Dates and Time에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by