how to create a sequence of time?

조회 수: 6 (최근 30일)
Lilya
Lilya 2021년 8월 2일
댓글: Lilya 2021년 8월 2일
Hi all,
I want to create a set of sequence of an hourly date and time starts from 2019,01,01 to 2019,12,31
then calculate the average of every 6 hours.
any help will be appreciated.

채택된 답변

Simon Chan
Simon Chan 2021년 8월 2일
How about the following?
It starts from 2019-01-01 00:00:00 to 2019-12-31 23:00:00 with 1 hour interval
datetime('2019-01-01')+hours(0:1:365*24-1)
First 4 output shown below:
01-Jan-2019 00:00:00 01-Jan-2019 01:00:00 01-Jan-2019 02:00:00 01-Jan-2019 03:00:00
  댓글 수: 3
Simon Chan
Simon Chan 2021년 8월 2일
Check function movmean, it may help you
Lilya
Lilya 2021년 8월 2일
thank you !!

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

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