How can I resample data with multiple time column?
조회 수: 1 (최근 30일)
이전 댓글 표시
19 1 1 0 0 0 1009.4 28.9 71.0 0.0 0.0 0.0 0.0
19 1 1 0 0 30 1009.4 28.8 71.0 0.0 0.0 0.0 0.0
19 1 1 0 1 0 1009.4 28.8 70.9 0.0 0.0 0.0 0.0
19 1 1 0 1 30 1009.3 28.8 70.9 0.0 0.0 0.0 0.0
19 1 1 0 2 0 1009.3 28.8 71.0 0.0 0.0 0.0 0.0
Dear matlab experts, I have a time series data. the first six column from the left are time value with YY:MM:DD:HH:MM:SS with space delimited format. I want to resample all value from secondly to daily. Do I need to convert time's column into timetable?
댓글 수: 0
채택된 답변
Star Strider
2022년 8월 8일
One approach —
M = [ 19 1 1 0 0 0 1009.4 28.9 71.0 0.0 0.0 0.0 0.0
19 1 1 0 0 30 1009.4 28.8 71.0 0.0 0.0 0.0 0.0
19 1 1 0 1 0 1009.4 28.8 70.9 0.0 0.0 0.0 0.0
19 1 1 0 1 30 1009.3 28.8 70.9 0.0 0.0 0.0 0.0
19 1 1 0 2 0 1009.3 28.8 71.0 0.0 0.0 0.0 0.0];
M(:,1) = M(:,1)+2000;
T1 = array2table(M(:,7:end));
DT = datetime(M(:,1:6));
T1 = addvars(T1,DT,'before','Var1')
TT1 = table2timetable(T1)
TT1rt = retime(TT1,'daily')
.
댓글 수: 2
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Tables에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!