Link data through timestamps
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi!
I loaded monitoringsdata in matlab as arrays.
As an example;
A B
[1-1-2015 0:00 20.0] [1-1-2015 0:01 154]
[1-1-2015 0:10 22.0] [1-1-2015 0:25 258]
[1-1-2015 0:20 10.0] [1-1-2015 0:33 598]
[1-1-2015 0:30 20.3] [1-1-2015 0:45 458]
[1-1-2015 0:40 14.7] [1-1-2015 0:58 987]
[1-1-2015 0:50 18.6]
[1-1-2015 1:00 13.9]
I want to plot(A,B) (or the other way around).
I want MATLAB to search for corresponding timestamps and link the data.
Most of the data is collected with an interval of 10min, but some data is random collected in time or with an interval of 1 min.
So not all arrays have the same lenght.
For example, I want 1-1-2015 0:40 to correspond with a datapoint (or the avarage of points) between 1-1-2015 0:35 and 1-1-2015 0:44.
Is it possible to do this with MATLAB? If yes, how?
I couldn't find much usefull material on the internet.
Thank you!
댓글 수: 1
Jan
2015년 12월 18일
The type and size of A and B and their elements is not clear. Perhaps you mean a string like: '1-1-2015 0:00 20.0', or a cell string like {'1-1-2015 0:00', '20.0'} or a mixed cell like {'1-1-2015 0:00', 20.0} or whatever. Please post the data in a format, which recreates it, when the readers insert it in the command window by copy&paste.
답변 (1개)
Jan
2015년 12월 18일
Convert the dates and times to Matlab's datenum format. Then find the corresponding bins using histcounts.
Explicite code can be posted, if you specify the data format uniquely.
참고 항목
카테고리
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!