Looking for information on sinking mismatched time series
조회 수: 2 (최근 30일)
이전 댓글 표시
Hi, I'm struggleing to phase a question so I can search the help file. I have two instruments producing 1 second data and I want to compare the out put directly, but as with all instrumentation, ocationaly, one instrument will drop a second so the two outputs are slightly mismatched in places. I am looking for a command whcih will allow me to create one time stamp with 2 columns of data with blanks where no data is available.
Example
data I have
data stream 1,,data stream 2,
17:31:01,333,17:31:01,332
17:31:02,345,17:31:02,344
17:31:04,321,17:31:03,326
17:31:05,365,17:31:05,363
17:31:06,352,17:31:06,358
17:31:07,389,17:31:08,381
data I want
Time,instrument1,instrument 2,
17:31:01,333,332,
17:31:02,345,344,
17:31:03,,326,
17:31:04,321,,
17:31:05,365,363,
17:31:06,352,358,
17:31:07,389,,
17:31:08,,381,
I'm not realy sure what to call this type of operation or if in fact matlab already has a command for this. I just feel like there should be one! Any help greatfully received.
Karen
댓글 수: 0
채택된 답변
Walter Roberson
2012년 4월 13일
unique() the two sets of timestamps together in the same array, to get the joint list of timestamps.
ismember() the first set of timestamps against the joint list. The locations not matched will require NaN for the first series.
ismember() the second set of timestamps against the joint list. The locations not matched will require NaN for the second series.
댓글 수: 0
추가 답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Shifting and Sorting Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!