필터 지우기
필터 지우기

Accumulate previous values in time serie

조회 수: 1 (최근 30일)
Danilo M
Danilo M 2018년 12월 20일
답변: the cyclist 2018년 12월 20일
I have a rain time series like this:
[year month day hour min rain]
2008 1 12 9 0 0
2008 1 12 10 0 0
2008 1 12 11 0 0
2008 1 12 12 0 0.2
2008 1 12 13 0 0.2
2008 1 12 14 0 1
2008 1 12 15 0 1.6
2008 1 12 16 0 2.2
2008 1 12 17 0 1.6
2008 1 12 18 0 0.8
2008 1 12 19 0 1.6
2008 1 12 20 0 0.8
2008 1 12 21 0 0.6
2008 1 12 22 0 0.6
2008 1 12 23 0 0.8
And I need to calculate rain accumulated on past 3, 6, 12, 24 and 48 hours, so, for example, for a 3-hour accumulate, the last line should sum 2 previous lines, resulting in
2008 1 12 23 0 2.0
How can I program this on MatLab?

채택된 답변

the cyclist
the cyclist 2018년 12월 20일
You should be able to use the movsum command.

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by