Trying to break time series data up by season
2 次查看(过去 30 天)
显示 更早的评论
I've got a 24 column csv file I am read and parse out 8 columns of interest and a timestamp (I can't riddle out how to get the timestamps to not come in as NAN so I use readmatrix and then pre-process a unix timestamp into a spare column) with this I end up making a timeTable in matlab as I convert the unix time stamp back to something matlab understands once it's in.
I have 30 years of data and a few plots (PDF, CDF, and boxplot) that I want to make for the whole data set as well as every fall, winter, summer, etc. The plots for the whole data set are a breeze with the statistics toolbox. so the question is - how do I create subsets of my data that are only certain seasons?
for a single year I could do something crude like this
spring = timeSeries(timeSeries.ts > '20-March-1980 12:00:00', :); % parse data before start date of spring
spring = spring(spring.ts < '21-June-1980 12:00:00', :); %parse data after stop date of spring
This doesnt readily scale to all 30 years of data. If I should not use time tables or something that's fine, I'm just using what I've seen in forums.
0 个评论
回答(1 个)
Agnish Dutta
2019-4-10
The "getsampleusingtime(tsin,starttime,endtime)" function could be used to create subsets of time series data. You can specify the 'starttime' and 'endtime' parameters corresponding to those of fall and spring, to effectively split the time series as required.
Refer to the following document for more information:
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Dates and Time 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!