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!