필터 지우기
필터 지우기

How to take monthly of time series using loop I am having data form each month( having 30/31) data values

조회 수: 2 (최근 30일)
How to take monthly average from each month using loop, and in one year there should be 12 values
  댓글 수: 2
Adam
Adam 2014년 9월 17일
Give an example of what your inputs look like otherwise it is impossible to answer. There aren't any prizes for the shortest "question" statement on the forum!
Chris Martin
Chris Martin 2014년 9월 18일
편집: Chris Martin 2014년 9월 18일
the time series example is given here..i need mean for every month..and its not only one year daya year also varies...the time series is like year month date valeu1 value 2 like that..I monthly mean such that in one year there is only 12 values...again this is not one year data.... http://www.mathworks.in/matlabcentral/answers/155193-how-to-take-monthly-of-time-series-using-loop

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

답변 (2개)

dpb
dpb 2014년 9월 17일

Andrei Bobrov
Andrei Bobrov 2014년 9월 18일
편집: Andrei Bobrov 2014년 9월 18일
load yourdata.mat
[ym,~,c] = unique(a(:,1:2),'rows');
s = size(a)-[0,3];
ii = repmat(c,s(2),1);
jj = repmat(1:s(2),s(1),1);
out = [ym,accumarray([ii,jj(:)],reshape(a(:,4:end),[],1),[],@mean)];

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by