필터 지우기
필터 지우기

Trying to break time series data up by season

조회 수: 3 (최근 30일)
Justin Bell
Justin Bell 2019년 4월 2일
댓글: Justin Bell 2020년 5월 20일
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.

답변 (1개)

Agnish Dutta
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:
  댓글 수: 1
Justin Bell
Justin Bell 2020년 5월 20일
That seems to suffer from the same issue of, it works between 2 date ranges, but can't iterate that span over several years. Unless I have missed something obvious in the documentation

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

카테고리

Help CenterFile Exchange에서 Timetables에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by