필터 지우기
필터 지우기

Monthly to annual totals

조회 수: 1 (최근 30일)
Anna
Anna 2012년 1월 23일
Hello,
I am hoping to convert monthly totals to annual totals using a loop. However, instead of using the calendar year (Jan-Dec) I want to use the water year which runs from October to September. I have a number of time series organised in a structure (468 rows, 1 column) starting from Oct 1960 and ending in Sept 1999.
I have attempted to sum up each 12 consecutive rows (1:12, 13:24 and so on) to get the annual totals but my code (below) is not doing the job (I am not sure what exactly it is doing) and I was hoping I could get some help fixing it. Many thanks!
for k=1:length(varnames)
p=0;
for i=1:39
for months=1:12
p=p+1;
annual_flow.(varnames{k})(i,1)=flow_monthly.(varnames{k})(p,1);
end
end
end

답변 (0개)

카테고리

Help CenterFile Exchange에서 Calendar에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by