moving window with 30-year data

1 visualización (últimos 30 días)
Poulomi Ganguli
Poulomi Ganguli el 16 de Oct. de 2017
Comentada: Poulomi Ganguli el 16 de Oct. de 2017
Hello, I have a matrix of time series data as attached. Time series lengths from 1970-2012. I need to extract moving block of 30-year window from this, with moving a year on every-time step. For example, the first block from 1970-2009, 2nd block 1971-2010, 1972-2011, and so on.
so something like this:
for i=size(unique(matrix(:,1),1)
30_yrblock = [my timeseries]
do whatever calculation with 30-year window
Result(i,:) = [];
end
However, I am not sure how to do so. Any help please?
Thanks!

Respuestas (1)

Steven Lord
Steven Lord el 16 de Oct. de 2017
Use the movmean function with the SamplePoints option. See the "Sample Points for Moving Average" example on that documentation page.
Alternately if your data is stored in a timetable use the retime function.
  1 comentario
Poulomi Ganguli
Poulomi Ganguli el 16 de Oct. de 2017
Thanks but I am not calculating moving average. I need a 30-year moving window.

Iniciar sesión para comentar.

Categorías

Más información sobre Tables en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by