How to do a 12-month average computation loop

2 views (last 30 days)
Jaaaaaaaai
Jaaaaaaaai on 10 Nov 2015
Edited: Jaaaaaaaai on 10 Nov 2015
So I have this data right here which spans from 2010 to 2014. I am trying to obtain the average of a 12month span.
For example, I am trying to obtain the 3rd column's average from Jan 2010~Dec 2010, then put the average on a row of a new matrix.
Next, I want to obtain the 3rd column's average from Feb 2010~Jan 2011, and put it on the new matrix's second row... and on.
Does anybody have an idea how to do this loop? I have a portion of my code but it is close to nil.
2039 40297.9168600000 2.60000000000000 2010 4
2009 40298.4671200000 1.40000000000000 2010 4
2151 40300.5642100000 0.900000000000000 2010 5
2144 40300.8513400000 2 2010 5
2135 40302.3340300000 1.20000000000000 2010 5

Answers (0)

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!