필터 지우기
필터 지우기

Monthly averages for each year using daily data in datenum form

조회 수: 1 (최근 30일)
Dave
Dave 2014년 12월 3일
댓글: Guillaume 2014년 12월 4일
Hi, I have matrix A (4000x2), the first column is daily data in datenum form. For example I have 734459, which using datestr brings 17-Nov-2010.
I did not see a post that answers this explicitly so I ask. How can I generate an array with monthly averages for each year of values of the second column? Thanks

채택된 답변

Guillaume
Guillaume 2014년 12월 3일
편집: Guillaume 2014년 12월 3일
See for example the answers to this question (for which the author unfortunately deleted away the original question, but it's essentially the same as yours).
Basically, use unique, or histc to bin your dates by year and month and find the indice of the bin each row lands in. Use accumarray with these indices to get the mean of column 2.
  댓글 수: 2
Dave
Dave 2014년 12월 4일
It is hard to follow the answers when you don't have the question but I sorted it out. Thanks
Guillaume
Guillaume 2014년 12월 4일
This answer is also similar (and the question is still there!)

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

추가 답변 (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