Accumulate previous values in time serie

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?

 Respuesta aceptada

the cyclist
the cyclist el 20 de Dic. de 2018

0 votos

You should be able to use the movsum command.

Más respuestas (0)

Categorías

Más información sobre Mathematics en Centro de ayuda y File Exchange.

Preguntada:

el 20 de Dic. de 2018

Respondida:

el 20 de Dic. de 2018

Community Treasure Hunt

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

Start Hunting!

Translated by