Looking for information on sinking mismatched time series

조회 수: 1 (최근 30일)
Karen Hornsby
Karen Hornsby 2012년 4월 13일
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

채택된 답변

Walter Roberson
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.

추가 답변 (1개)

Sean de Wolski
Sean de Wolski 2012년 4월 13일
Fill those points with Nan.
doc nan
  댓글 수: 1
Karen Hornsby
Karen Hornsby 2012년 4월 13일
I realize I will need to add nans to the output, but I want to know how to generate the single time stamp and then sample the data into a single matrix.

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by