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!

답변 (1개)

Steven Lord
Steven Lord 2017년 10월 16일

0 개 추천

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

Poulomi Ganguli
Poulomi Ganguli 2017년 10월 16일
Thanks but I am not calculating moving average. I need a 30-year moving window.

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

카테고리

도움말 센터File Exchange에서 Logical에 대해 자세히 알아보기

질문:

2017년 10월 16일

댓글:

2017년 10월 16일

Community Treasure Hunt

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

Start Hunting!

Translated by