Daily data into month

I have data in A=2620x1 matrix and 2620 are days showing data daily data. I want to collect each day data month-wise column. How can i do that? Please include leap year too.

4 Comments

KSSV
KSSV on 28 Sep 2017
YOu must be having dates....convert it to datevec and pick the monthly data.
A lot more details are required to be able to answer your question. What form does your matrix take? How is the date stored? What does collect mean? What goes in each row of the month-wise column? Each day? If so, since months don't have the same number of days, what do you do with the shorter rows.
Giving an example input and desired output would help
Ok, Here, I am explaining it more my data is 2620x2... first col is date (starting from July 3, 2001) and second col is precipitation data. I want July 2001 in first col, Aug 2001 in second col, Sep 2001 in third col and so on..
I'll repeat my questions, then
How is the date stored? Is it a datevec, a datetime, a datestr, a datenum, something else?
What goes in the row of the columns? If it's the precipitation data unprocessed, what do you want to do with the shorter months? Bearing in mind that all columns of a matrix must have the same number of rows?
Give us an example of input and desired output.

Sign in to comment.

Answers (0)

Asked:

on 28 Sep 2017

Commented:

on 28 Sep 2017

Community Treasure Hunt

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

Start Hunting!