For more than 2 years, I have 1437x15 9x1253 large matrix (let's call it A) in daily sea ice data. I
< P> I have to write a code that takes daily data from each month and it means (A, 3) on it. So basically, in 1253 days t is. If I start from January, then I have to make the mean of 31 days (A3), then the meaning of February (A, 3), next 28 or 29 days because between 31 and 30 alternate (and February 28 or 29), I do not know how to write code to do this. I can do it manually, but it will take some time.
Thank you!
You can start an array with the number of days in each month, mon = Using boolean [31, 28, 31, 30, 31, 30, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] to check that it is a leap year ( som (2 ) = 29 to set up) The number of days each month will help your index properly, such as the use of a loop:
index = 1; I = 1: 12 average = mean (A (: ,, ,,: Index: (Index + Mon (I)), 3) Index = Index + M (I);% Start of the end of next month
No comments:
Post a Comment