How to take monthly of time series using loop I am having data form each month( having 30/31) data values
Mostrar comentarios más antiguos
How to take monthly average from each month using loop, and in one year there should be 12 values
2 comentarios
Adam
el 17 de Sept. de 2014
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
el 18 de Sept. de 2014
Editada: Chris Martin
el 18 de Sept. de 2014
Respuestas (2)
dpb
el 17 de Sept. de 2014
1 voto
This question was just asked (again) and answered at
Andrei Bobrov
el 18 de Sept. de 2014
Editada: Andrei Bobrov
el 18 de Sept. de 2014
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)];
Categorías
Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!