merge date time
조회 수: 1 (최근 30일)
이전 댓글 표시
How can I merge the two columns together (into one) and generate a date time number for data like
20101229 154907
20101229 154908
20101229 154908
20101229 154909
20101229 154909
20101230 93001
20101230 93001
20101230 93004
and a result like
2010229154907 for row 1
2010229154907 for row 2 and so on
dates and times are doubles
thanks
댓글 수: 0
답변 (3개)
Walter Roberson
2012년 2월 3일
Do not accumarray() using these numbers as the subscripts. Instead,
Mu = unique(mergedtimes);
[tf, Muidx] = ismember(mergedtimes, Mu);
Then uses MuIdx(:) as the subscript for accumarray() purposes. Afterwards, you can map back row K of your accumarray results to time value Mu(K)
댓글 수: 3
Walter Roberson
2012년 2월 4일
mod(mergedtime, 1000000) to get the time data,
fix(mergedtime ./ 1000000) to get the data data.
참고 항목
카테고리
Help Center 및 File Exchange에서 Time Series Objects에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!